services:
  ddns:
    build: ./ddns
    container_name: ddns
    restart: always
    command: ["${REGRU_LOGIN:?}", "${REGRU_PASSWORD:?}"]
    volumes:
      - ./ddns/domains.txt:/app/domains.txt
    environment:
      - TZ=Europe/Samara
    deploy:
      resources:
        limits:
          cpus: '0.25'
          memory: 128M
        reservations:
          memory: 64M

  nginx-proxy:
    image: docker.io/nginx:alpine
    container_name: nginx-proxy
    restart: always
    ports:
      - 8080:80
    volumes:
      - ./nginx/init:/etc/nginx/conf.d:ro
      # Папки для SSL сертификатов
      - ./ssl/conf:/etc/letsencrypt:ro
      - ./ssl/www:/var/www/certbot:ro
    deploy:
      resources:
        limits:
          cpus: '0.25'
          memory: 128M
        reservations:
          memory: 64M
