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:
parent
34ced61b51
commit
8ad25aff98
1 changed files with 14 additions and 5 deletions
|
|
@ -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}
|
||||
|
|
|
|||
Loading…
Reference in a new issue