Compare commits

...

3 commits

Author SHA1 Message Date
dlawler489
5dfe809eb2 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>
2026-06-22 20:47:06 +10:00
dlawler489
8ad25aff98 compose: route via shared Traefik network instead of host port
Drop the published host port (it clashed on the deploy host) and attach
the app to the external Traefik network so Traefik routes to it directly.
Stable container_name printhive-app for the file provider to target;
network name configurable via TRAEFIK_NETWORK.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-22 20:45:02 +10:00
dlawler489
34ced61b51 compose: make host port configurable (APP_PORT)
Host port 3000 can clash with other services on the deploy host; allow
overriding via APP_PORT (default 3000). Only needed for Traefik to reach
the app — can be dropped entirely if Traefik shares the Docker network.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-22 20:43:05 +10:00

View file

@ -19,6 +19,7 @@ services:
# docker build -t git.plexultra.com/dlawler489/printhive:latest . # docker build -t git.plexultra.com/dlawler489/printhive:latest .
image: git.plexultra.com/dlawler489/printhive:latest image: git.plexultra.com/dlawler489/printhive:latest
pull_policy: always pull_policy: always
container_name: printhive-app # stable name for the Traefik file-provider to target
depends_on: depends_on:
db: db:
condition: service_healthy condition: service_healthy
@ -34,19 +35,30 @@ services:
- uploads:/app/uploads - uploads:/app/uploads
- thumbnails:/app/thumbnails - thumbnails:/app/thumbnails
- glb:/app/glb - glb:/app/glb
ports: # No host port published — Traefik auto-discovers the app on the shared network.
- "3000:3000" networks:
- default # talk to the db
- 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:
uploads: uploads:
thumbnails: thumbnails:
glb: glb:
networks:
default:
# The existing Traefik network (same one your other services use).
# Set TRAEFIK_NETWORK in Dockhand to its exact name.
traefik:
external: true
name: ${TRAEFIK_NETWORK:-traefik}