Stop publishing a host port
`docker compose up` failed with "port is already allocated": 3000 was taken by an unrelated project on the same machine. Publishing it was never needed — in production the only thing that has to reach this service is the reverse proxy, which does so over the compose network as `landing:3000`. `expose` replaces `ports`, and a commented `ports` block stays for the cases that do want a host binding. LANDING_PORT is kept but re-labelled as only mattering then. Verified: the container binds nothing on the host, answers 200 with the full page from another container on the network, and stays healthy — its health check was always internal. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -24,8 +24,20 @@ services:
|
||||
- nexus_token
|
||||
image: pireon/landing:latest
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- '${LANDING_PORT:-3000}:3000'
|
||||
# No `ports`. Publishing on the host collides with whatever else is using
|
||||
# that number on the machine, and in production the only thing that needs
|
||||
# to reach this is the reverse proxy — which does so over the compose
|
||||
# network, by service name, on the port below.
|
||||
#
|
||||
# proxy_pass http://landing:3000;
|
||||
#
|
||||
# To reach it from the host anyway (a quick check, or a deployment with no
|
||||
# proxy in front), uncomment this and set LANDING_PORT to a free port:
|
||||
#
|
||||
# ports:
|
||||
# - '${LANDING_PORT:-3000}:3000'
|
||||
expose:
|
||||
- '3000'
|
||||
environment:
|
||||
# Where the public API lives. The only setting the app actually reads.
|
||||
PIREON_API_URL: ${PIREON_API_URL:-https://landing-api.pireon.dev/api}
|
||||
|
||||
Reference in New Issue
Block a user