compose: Traefik label-based auto-discovery
All checks were successful
build-and-push / docker (push) Successful in 26s

Add Traefik labels so the Docker provider auto-discovers the app.
Includes traefik.docker.network (the app is on two networks) which is
the usual fix for routing not resolving. Host/entrypoint/certresolver
overridable via PRINTHIVE_HOST / TRAEFIK_ENTRYPOINT / TRAEFIK_CERTRESOLVER.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
dlawler489 2026-06-22 20:47:06 +10:00
parent 8ad25aff98
commit 5dfe809eb2

View file

@ -35,19 +35,19 @@ services:
- uploads:/app/uploads - uploads:/app/uploads
- thumbnails:/app/thumbnails - thumbnails:/app/thumbnails
- glb:/app/glb - glb:/app/glb
# No host port published — Traefik reaches the app over the shared network # No host port published — Traefik auto-discovers the app on the shared network.
# at http://printhive-app:3000 (configure that in your Traefik file provider).
networks: networks:
- default # talk to the db - default # talk to the db
- traefik # reachable by Traefik - traefik # reachable by Traefik
restart: unless-stopped restart: unless-stopped
# Traefik (if using labels rather than your file provider): labels:
# labels: - "traefik.enable=true"
# - "traefik.enable=true" # App is on two networks; tell Traefik which one to reach it on.
# - "traefik.http.routers.printhive.rule=Host(`printhive.plexultra.com`)" - "traefik.docker.network=${TRAEFIK_NETWORK:-traefik}"
# - "traefik.http.routers.printhive.entrypoints=websecure" - "traefik.http.routers.printhive.rule=Host(`${PRINTHIVE_HOST:-printhive.plexultra.com}`)"
# - "traefik.http.routers.printhive.tls.certresolver=letsencrypt" - "traefik.http.routers.printhive.entrypoints=${TRAEFIK_ENTRYPOINT:-websecure}"
# - "traefik.http.services.printhive.loadbalancer.server.port=3000" - "traefik.http.routers.printhive.tls.certresolver=${TRAEFIK_CERTRESOLVER:-letsencrypt}"
- "traefik.http.services.printhive.loadbalancer.server.port=3000"
volumes: volumes:
pgdata: pgdata: