version: "3"

services:
  nginx:
    container_name: nginx
    image: nginx:alpine
    volumes: 
      - ./site:/usr/share/nginx/html
    ports:
      - 8008:80
    restart: unless-stopped
    command: /bin/sh -c "while :; do sleep 6h & wait $${!}; nginx -s reload; done & nginx -g 'daemon off;'" 
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.dummy.entrypoints=websecure"
      - "traefik.http.routers.dummy.rule=Host(`site.$DOMAIN_NAME`)"
      - "traefik.http.routers.dummy.tls.certresolver=letsencr"
networks:
  default:
    external:
      name: $DEFAULT_NETWORK
