Fix port conflict: use !reset tag to replace base ports, not append
Docker Compose merges port lists from multiple -f files by concatenation. Without !reset, both 0.0.0.0:8000:8000 (base) and 127.0.0.1:8000:8000 (prod override) are applied simultaneously, causing "port already allocated". !reset clears the list before applying prod-specific bindings (requires Docker Compose v2.24+, available in current docker-compose-plugin via apt). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
f73291285d
commit
d10759b4de
1 changed files with 4 additions and 4 deletions
|
|
@ -10,13 +10,13 @@
|
|||
|
||||
services:
|
||||
postgres:
|
||||
ports: []
|
||||
ports: !reset []
|
||||
|
||||
redis:
|
||||
ports: []
|
||||
ports: !reset []
|
||||
|
||||
api:
|
||||
ports:
|
||||
ports: !reset
|
||||
- "127.0.0.1:${API_PORT:-8000}:8000"
|
||||
environment:
|
||||
PYTHONUNBUFFERED: "1"
|
||||
|
|
@ -26,7 +26,7 @@ services:
|
|||
PYTHONUNBUFFERED: "1"
|
||||
|
||||
web:
|
||||
ports:
|
||||
ports: !reset
|
||||
- "127.0.0.1:${WEB_PORT:-3000}:3000"
|
||||
environment:
|
||||
NEXT_PUBLIC_BASE_PATH: "/ppt-tool"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue