traefik integration

This commit is contained in:
2025-11-17 12:53:52 +01:00
parent 6e185c025d
commit c6db4dce48

View File

@@ -204,8 +204,8 @@ services:
build: ./frontend build: ./frontend
container_name: munich-news-frontend container_name: munich-news-frontend
restart: unless-stopped restart: unless-stopped
ports: # ports:
- "3000:3000" # - "3000:3000"
# Traefik Configuration (commented out - uncomment when using Traefik) # Traefik Configuration (commented out - uncomment when using Traefik)
# Remove port exposure when using Traefik # Remove port exposure when using Traefik
# ports: # ports:
@@ -217,11 +217,25 @@ services:
- backend - backend
networks: networks:
- munich-news-network - munich-news-network
- proxy
healthcheck: healthcheck:
test: ["CMD", "wget", "--quiet", "--tries=1", "--spider", "http://localhost:3000"] test: ["CMD", "wget", "--quiet", "--tries=1", "--spider", "http://localhost:3000"]
interval: 30s interval: 30s
timeout: 10s timeout: 10s
retries: 3 retries: 3
labels:
- traefik.enable=true
- traefik.docker.network=proxy
- traefik.http.routers.news.entrypoints=http
- traefik.http.routers.news.rule=Host(`news.dongho.kim`)
- traefik.http.middlewares.news-redirect.redirectscheme.permanent=true
- traefik.http.middlewares.news-redirect.redirectscheme.scheme=https
- traefik.http.routers.news.middlewares=news-redirect
- traefik.http.routers.news-secure.entrypoints=https
- traefik.http.routers.news-secure.rule=Host(`news.dongho.kim`)
- traefik.http.routers.news-secure.tls=true
- traefik.http.routers.news-secure.tls.certresolver=cloudflare
- traefik.http.services.news-secure-service.loadbalancer.server.port=2283
volumes: volumes:
mongodb_data: mongodb_data:
@@ -233,4 +247,6 @@ volumes:
networks: networks:
munich-news-network: munich-news-network:
driver: bridge internal: true
proxy:
external: true