chore(compose): add default fallbacks for domain and container name

This commit is contained in:
kiskaadee committed 2026-09-03 21:27:39 -05:00
1 parent cf6285c07b
commit a79e48e462
1 file changed
+9 -9
+9 -9
View File
@@ -1,7 +1,7 @@
services: services:
docs: docs:
build: . build: .
container_name: ${SERVICE_NAME} container_name: ${SERVICE_NAME:-docs}
restart: unless-stopped restart: unless-stopped
volumes: volumes:
- ${PROJECT_PATH:-./data}:/docs:ro - ${PROJECT_PATH:-./data}:/docs:ro
@@ -13,18 +13,18 @@ services:
- proxy - proxy
labels: labels:
- "traefik.enable=true" - "traefik.enable=true"
- "traefik.http.routers.${SERVICE_NAME}.rule=Host(`${SERVICE_DOMAIN}`)" - "traefik.http.routers.${SERVICE_NAME:-docs}.rule=Host(`${SERVICE_DOMAIN:-docs.roadtotech.me}`)"
- "traefik.http.routers.${SERVICE_NAME}.entrypoints=websecure" - "traefik.http.routers.${SERVICE_NAME:-docs}.entrypoints=websecure"
- "traefik.http.routers.${SERVICE_NAME}.tls=true" - "traefik.http.routers.${SERVICE_NAME:-docs}.tls=true"
- "traefik.http.routers.${SERVICE_NAME}.service=${SERVICE_NAME}-svc" - "traefik.http.routers.${SERVICE_NAME:-docs}.service=${SERVICE_NAME:-docs}-svc"
# HTTP to HTTPS redirect # HTTP to HTTPS redirect
- "traefik.http.routers.${SERVICE_NAME}-red.rule=Host(`${SERVICE_DOMAIN}`)" - "traefik.http.routers.${SERVICE_NAME:-docs}-red.rule=Host(`${SERVICE_DOMAIN:-docs.roadtotech.me}`)"
- "traefik.http.routers.${SERVICE_NAME}-red.entrypoints=web" - "traefik.http.routers.${SERVICE_NAME:-docs}-red.entrypoints=web"
- "traefik.http.routers.${SERVICE_NAME}-red.middlewares=https-redirect@docker" - "traefik.http.routers.${SERVICE_NAME:-docs}-red.middlewares=https-redirect@docker"
# Target Port # Target Port
- "traefik.http.services.${SERVICE_NAME}-svc.loadbalancer.server.port=8000" - "traefik.http.services.${SERVICE_NAME:-docs}-svc.loadbalancer.server.port=8000"
networks: networks:
proxy: proxy: