Files
devplacepy/docker-compose.yml
T
retoorandClaude Sonnet 5 dcd90cc907 Make the app's port configurable via DEVPLACE_PORT
make dev/prod hardcoded uvicorn to port 10500 with no way to override it,
so config.PORT (and everything derived from it - INTERNAL_BASE_URL,
Devii's own base URL defaults) stayed 10500 regardless of what port the
process actually bound to. DEVPLACE_PORT now drives all of it, defaulting
to 10500. Docker's existing PORT var (the externally published port via
nginx) is unrelated and untouched; its app container pins DEVPLACE_PORT
to 10500 explicitly so a bare-metal .env value can never leak in and
desync it from the Dockerfile's fixed internal bind port.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-03 08:16:05 +00:00

57 lines
1.4 KiB
YAML

name: devplace
services:
app:
build:
context: .
dockerfile: Dockerfile
restart: unless-stopped
env_file:
- .env
user: "${DEVPLACE_UID:-1000}:${DEVPLACE_GID:-1000}"
working_dir: /app
environment:
HOME: /app
PYTHONDONTWRITEBYTECODE: "1"
# Pinned regardless of .env: the container always binds 10500 internally
# (Dockerfile CMD, nginx upstream). DEVPLACE_PORT is the bare-metal
# `make dev`/`make prod` knob; the externally reachable port is `PORT`.
DEVPLACE_PORT: "10500"
volumes:
- .:/app
expose:
- "10500"
networks:
- appnet
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:10500/"]
interval: 30s
timeout: 10s
retries: 3
start_period: 120s
start_interval: 2s
nginx:
build:
context: .
dockerfile: nginx/Dockerfile
restart: unless-stopped
ports:
- "127.0.0.1:${PORT:-10500}:80"
environment:
NGINX_CACHE_ENABLED: "${NGINX_CACHE_ENABLED:-false}"
NGINX_CACHE_MAX_SIZE: "${NGINX_CACHE_MAX_SIZE:-1g}"
NGINX_MAX_BODY_SIZE: "${NGINX_MAX_BODY_SIZE:-50m}"
volumes:
- ./devplacepy/static:/app/static:ro
- ${DEVPLACE_DATA_DIR:-./data}/uploads:/data/uploads:ro
depends_on:
app:
condition: service_healthy
networks:
- appnet
networks:
appnet:
driver: bridge