|
| 1 | +services: |
| 2 | + # Frontend static server (Nginx) |
| 3 | + frontend: |
| 4 | + build: |
| 5 | + context: ./frontend |
| 6 | + labels: |
| 7 | + - "org.pseudolab.project=devfactory-platform" |
| 8 | + container_name: devfactory-frontend |
| 9 | + restart: unless-stopped |
| 10 | + networks: |
| 11 | + - traefik |
| 12 | + - internal |
| 13 | + labels: |
| 14 | + - traefik.enable=true |
| 15 | + - traefik.docker.network=traefik |
| 16 | + # --- Traefik Router (frontend) --- |
| 17 | + - traefik.http.routers.df-platform-web.rule=Host(`${APP_HOST}`) |
| 18 | + - traefik.http.routers.df-platform-web.entrypoints=websecure |
| 19 | + - traefik.http.routers.df-platform-web.tls=true |
| 20 | + - traefik.http.routers.df-platform-web.tls.certresolver=le |
| 21 | + - traefik.http.services.df-platform-web.loadbalancer.server.port=80 |
| 22 | + # HTTP → HTTPS redirect |
| 23 | + - traefik.http.routers.df-platform-web-http.rule=Host(`${APP_HOST}`) |
| 24 | + - traefik.http.routers.df-platform-web-http.entrypoints=web |
| 25 | + - traefik.http.routers.df-platform-web-http.middlewares=redirect-to-https@file |
| 26 | + - traefik.http.routers.df-platform-web-http.service=df-platform-web |
| 27 | + |
| 28 | + # Backend API server |
| 29 | + server: |
| 30 | + build: |
| 31 | + context: ./server |
| 32 | + labels: |
| 33 | + - "org.pseudolab.project=devfactory-platform" |
| 34 | + container_name: devfactory-api |
| 35 | + restart: unless-stopped |
| 36 | + environment: |
| 37 | + - DATABASE_URL=${DATABASE_URL} |
| 38 | + - PORT=3000 |
| 39 | + networks: |
| 40 | + - traefik |
| 41 | + - internal |
| 42 | + labels: |
| 43 | + - traefik.enable=true |
| 44 | + - traefik.docker.network=traefik |
| 45 | + # --- Traefik Router (backend) --- |
| 46 | + - traefik.http.routers.df-platform-api.rule=Host(`${APP_HOST}`) && PathPrefix(`/api`) |
| 47 | + - traefik.http.routers.df-platform-api.entrypoints=websecure |
| 48 | + - traefik.http.routers.df-platform-api.tls=true |
| 49 | + - traefik.http.routers.df-platform-api.tls.certresolver=le |
| 50 | + - traefik.http.services.df-platform-api.loadbalancer.server.port=3000 |
| 51 | + # HTTP → HTTPS redirect |
| 52 | + - traefik.http.routers.df-platform-api-http.rule=Host(`${APP_HOST}`) && PathPrefix(`/api`) |
| 53 | + - traefik.http.routers.df-platform-api-http.entrypoints=web |
| 54 | + - traefik.http.routers.df-platform-api-http.middlewares=redirect-to-https@file |
| 55 | + - traefik.http.routers.df-platform-api-http.service=df-platform-api |
| 56 | + |
| 57 | +networks: |
| 58 | + traefik: |
| 59 | + external: true |
| 60 | + internal: |
| 61 | + driver: bridge |
0 commit comments