Archived
chore(compose): add default fallbacks for domain and container name
This commit is contained in:
1 parent
cf6285c07b
commit
a79e48e462
1 file changed
+9
-9
+9
-9
@@ -1,7 +1,7 @@
|
||||
services:
|
||||
docs:
|
||||
build: .
|
||||
container_name: ${SERVICE_NAME}
|
||||
container_name: ${SERVICE_NAME:-docs}
|
||||
restart: unless-stopped
|
||||
volumes:
|
||||
- ${PROJECT_PATH:-./data}:/docs:ro
|
||||
@@ -13,18 +13,18 @@ services:
|
||||
- proxy
|
||||
labels:
|
||||
- "traefik.enable=true"
|
||||
- "traefik.http.routers.${SERVICE_NAME}.rule=Host(`${SERVICE_DOMAIN}`)"
|
||||
- "traefik.http.routers.${SERVICE_NAME}.entrypoints=websecure"
|
||||
- "traefik.http.routers.${SERVICE_NAME}.tls=true"
|
||||
- "traefik.http.routers.${SERVICE_NAME}.service=${SERVICE_NAME}-svc"
|
||||
- "traefik.http.routers.${SERVICE_NAME:-docs}.rule=Host(`${SERVICE_DOMAIN:-docs.roadtotech.me}`)"
|
||||
- "traefik.http.routers.${SERVICE_NAME:-docs}.entrypoints=websecure"
|
||||
- "traefik.http.routers.${SERVICE_NAME:-docs}.tls=true"
|
||||
- "traefik.http.routers.${SERVICE_NAME:-docs}.service=${SERVICE_NAME:-docs}-svc"
|
||||
|
||||
# HTTP to HTTPS redirect
|
||||
- "traefik.http.routers.${SERVICE_NAME}-red.rule=Host(`${SERVICE_DOMAIN}`)"
|
||||
- "traefik.http.routers.${SERVICE_NAME}-red.entrypoints=web"
|
||||
- "traefik.http.routers.${SERVICE_NAME}-red.middlewares=https-redirect@docker"
|
||||
- "traefik.http.routers.${SERVICE_NAME:-docs}-red.rule=Host(`${SERVICE_DOMAIN:-docs.roadtotech.me}`)"
|
||||
- "traefik.http.routers.${SERVICE_NAME:-docs}-red.entrypoints=web"
|
||||
- "traefik.http.routers.${SERVICE_NAME:-docs}-red.middlewares=https-redirect@docker"
|
||||
|
||||
# Target Port
|
||||
- "traefik.http.services.${SERVICE_NAME}-svc.loadbalancer.server.port=8000"
|
||||
- "traefik.http.services.${SERVICE_NAME:-docs}-svc.loadbalancer.server.port=8000"
|
||||
|
||||
networks:
|
||||
proxy:
|
||||
|
||||
Reference in new issue
Block a user