Files
bellsystems-cp/docker-compose.yml
T
bonaminandClaude Opus 5.5 18705aaefb fix(docker): keep server Postgres on ./data/postgres, move Windows volume to an override
751cac7 switched the base compose file to an external named volume
(bellsystems-postgres-data) to dodge a WSL2/Docker Desktop bind-mount bug.
That volume only exists on the Windows dev machine: on the VPS, where the
push auto-deploys via deploy-host.sh, `docker compose up` would fail on the
missing external volume (or, if created, start Postgres on an empty
database while the real data sat unused in ./data/postgres).

The base file goes back to the ./data/postgres bind mount the server has
always used (Linux has no such bug). The named volume now lives in
docker-compose.override.yml, which Compose loads automatically, is
gitignored, and is created from docker-compose.override.example.yml on
Windows machines only.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-30 16:45:58 +03:00

68 lines
1.8 KiB
YAML

services:
backend:
build: ./backend
container_name: bellsystems-backend
restart: unless-stopped
env_file: .env
volumes:
- ./backend:/app
- ./data:/app/data
- ./data/built_melodies:/app/storage/built_melodies
- ./data/firmware:/app/storage/firmware
- ./data/flash_assets:/app/storage/flash_assets
- ./data/melody_binaries:/app/storage/melody_binaries
- ./data/firebase-service-account.json:/app/firebase-service-account.json:ro
ports:
- "8000:8000"
depends_on:
postgres:
condition: service_healthy
networks:
- internal
frontend:
build: ./frontend
container_name: bellsystems-frontend
restart: unless-stopped
networks:
- internal
nginx:
image: nginx:alpine
container_name: bellsystems-nginx
restart: unless-stopped
ports:
- "90:80" # access v2 on localhost:8001
volumes:
- ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro
depends_on:
- backend
- frontend
networks:
- internal
postgres:
image: postgres:16-alpine
container_name: bellsystems-postgres
restart: unless-stopped
environment:
POSTGRES_DB: ${POSTGRES_DB}
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
volumes:
# Server default: plain folder on the host (Linux, no WSL2 issues).
# Windows dev machines override this with a Docker volume in
# docker-compose.override.yml — see docker-compose.override.example.yml.
- ./data/postgres:/var/lib/postgresql/data
networks:
- internal
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}"]
interval: 10s
timeout: 5s
retries: 5
networks:
internal:
driver: bridge