# Docker Compose configuration for BtToxin Pipeline with Traefik # This configuration removes the internal Nginx and lets Traefik handle routing # The container exposes port 8000 where FastAPI serves both API and frontend services: bttoxin: build: context: ../.. dockerfile: docker/dockerfiles/Dockerfile.traefik container_name: bttoxin-pipeline # No ports section - Traefik will handle routing via the container network volumes: - ../../jobs:/app/jobs environment: - JOBS_DIR=/app/jobs # No need for ROOT_PATH since Traefik handles the routing restart: unless-stopped networks: - traefik-network labels: # Enable Traefik for this container - "traefik.enable=true" # HTTP Router (redirect to HTTPS) - "traefik.http.routers.bttoxin.rule=Host(`bttiaw.hzau.edu.cn`)" - "traefik.http.routers.bttoxin.entrypoints=web" - "traefik.http.routers.bttoxin.middlewares=redirect-to-https" # HTTPS Router - "traefik.http.routers.bttoxin-secure.rule=Host(`bttiaw.hzau.edu.cn`)" - "traefik.http.routers.bttoxin-secure.entrypoints=websecure" - "traefik.http.routers.bttoxin-secure.tls=true" # Service configuration - "traefik.http.services.bttoxin.loadbalancer.server.port=8000" # TLS redirect middleware - "traefik.http.middlewares.redirect-to-https.redirectscheme.scheme=https" - "traefik.http.middlewares.redirect-to-https.redirectscheme.permanent=true" networks: traefik-network: external: true # Create this network first: docker network create traefik-network # Or set external: false to let docker-compose create it # Example Traefik configuration (traefik.yml): # # services: # traefik: # image: traefik:v2.10 # command: # - "--api.insecure=true" # - "--providers.docker=true" # - "--providers.docker.exposedbydefault=false" # - "--entrypoints.web.address=:80" # - "--entrypoints.websecure.address=:443" # ports: # - "80:80" # - "443:443" # - "8080:8080" # Traefik dashboard # volumes: # - "/var/run/docker.sock:/var/run/docker.sock:ro" # networks: # - traefik-network # # networks: # traefik-network: