From 8ad25aff98d7d7ef6c762fb497c3b2c08eadd0e4 Mon Sep 17 00:00:00 2001 From: dlawler489 <104159223@student.swin.edu.au> Date: Mon, 22 Jun 2026 20:45:02 +1000 Subject: [PATCH] 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 --- docker-compose.yml | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index cb3127d..957ffe1 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -19,6 +19,7 @@ services: # docker build -t git.plexultra.com/dlawler489/printhive:latest . image: git.plexultra.com/dlawler489/printhive:latest pull_policy: always + container_name: printhive-app # stable name for the Traefik file-provider to target depends_on: db: condition: service_healthy @@ -34,11 +35,11 @@ services: - uploads:/app/uploads - thumbnails:/app/thumbnails - glb:/app/glb - # Host port is only for Traefik to reach the app; set APP_PORT to any free - # port (3000 was already taken on the host). If Traefik shares the Docker - # network and routes by container, you can drop this whole `ports:` block. - ports: - - "${APP_PORT:-3000}:3000" + # No host port published — Traefik reaches the app over the shared network + # at http://printhive-app:3000 (configure that in your Traefik file provider). + networks: + - default # talk to the db + - traefik # reachable by Traefik restart: unless-stopped # Traefik (if using labels rather than your file provider): # labels: @@ -53,3 +54,11 @@ volumes: uploads: thumbnails: 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}