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>
This commit is contained in:
dlawler489 2026-06-22 20:45:02 +10:00
parent 34ced61b51
commit 8ad25aff98

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,11 +35,11 @@ services:
- uploads:/app/uploads - uploads:/app/uploads
- thumbnails:/app/thumbnails - thumbnails:/app/thumbnails
- glb:/app/glb - glb:/app/glb
# Host port is only for Traefik to reach the app; set APP_PORT to any free # No host port published — Traefik reaches the app over the shared network
# port (3000 was already taken on the host). If Traefik shares the Docker # at http://printhive-app:3000 (configure that in your Traefik file provider).
# network and routes by container, you can drop this whole `ports:` block. networks:
ports: - default # talk to the db
- "${APP_PORT:-3000}:3000" - traefik # reachable by Traefik
restart: unless-stopped restart: unless-stopped
# Traefik (if using labels rather than your file provider): # Traefik (if using labels rather than your file provider):
# labels: # labels:
@ -53,3 +54,11 @@ volumes:
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}