services: app: build: context: . dockerfile: Dockerfile container_name: allAndOne env_file: - .env ports: - "3000:3000" volumes: - .:/app - /app/node_modules labels: - traefik.enable=true - traefik.docker.network=traefik-public - traefik.constraint-label=traefik-public - traefik.http-frontend.loadbalancer.server.port=80 - traefik.http.routers.frontend-http.rule=Host(`${DOMAIN?Variable not set}`) || Host(`www.${DOMAIN?Variable not set}`) - traefik.http.routers.frontend-http.entrypoints=http - traefik.http.routers.frontend-https.rule=Host(`${DOMAIN?Variable not set}`) || Host(`www.${DOMAIN?Variable not set}`) - traefik.http.routers.frontend-https.entrypoints=https - traefik.http.routers.frontend-https.tls=true - traefik.http.routers.frontend-https.tls.certresolver=le # Enable www redirection for HTTP and HTTPS - traefik.http.routers.frontend-https.middlewares=www-redirect - traefik.http.routers.frontend-http.middlewares=https-redirect,www-redirect networks: - traefik-public - default networks: traefik-public: # Allow setting it to false for testing external: true