read.markets/docker-compose.prod.yml
Giorgio Gilestro 7364d11ffe deploy: add prod compose overlay (no host port, joins intranet network)
The VPS deployment sits behind Nginx Proxy Manager on a pre-existing
`intranet` Docker bridge network. The overlay drops the host port
binding from the base compose, switches uvicorn to listen on port 80
inside the container (uniform NPM upstreams), and joins the app to
both `default` (for db/redis) and `intranet` (for NPM ingress).

Apply with:
  docker compose -f docker-compose.yml -f docker-compose.prod.yml up -d

Local dev (compose without the overlay) is unchanged — still binds
the host port from CASSANDRA_PORT in .env.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-22 21:26:55 +01:00

28 lines
938 B
YAML

# Production overlay. Applied on the VPS with:
#
# docker compose -f docker-compose.yml -f docker-compose.prod.yml up -d
#
# Drops the host port binding entirely and joins the `intranet` external
# Docker network so a front-side proxy (Nginx Proxy Manager) on the same
# network can reach the container directly. The app listens on port 80
# inside the container so NPM upstreams are uniform across services
# (always `<container-name>:80`).
#
# The local-dev compose (just `docker-compose.yml` alone) still binds to
# the host port from `.env` / CASSANDRA_PORT — unchanged.
services:
app:
# Strip the host port binding from the base file: no public listener
# on the VPS, only the intranet bridge.
ports: []
command: ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "80", "--workers", "1"]
expose:
- "80"
networks:
- default
- intranet
networks:
intranet:
external: true