Files
ems-core/docker-compose.prod.yml
Du Wenbo 139ca4c128 feat!: backend-only architecture, remove frontend/nginx (v1.2.0)
- Remove frontend/ and nginx/ from core (each customer owns their frontend)
- Update docker-compose.yml to backend-only (postgres + redis + backend)
- Update docker-compose.prod.yml to backend-only
- Add CLAUDE.md with dev guidelines
- Update README.md with new architecture diagram

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 23:39:31 +08:00

106 lines
2.3 KiB
YAML

version: '3.8'
services:
postgres:
image: timescale/timescaledb:latest-pg16
container_name: tianpu_db
environment:
POSTGRES_DB: ${POSTGRES_DB:-tianpu_ems}
POSTGRES_USER: ${POSTGRES_USER:-tianpu}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
volumes:
- pgdata:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-tianpu} -d ${POSTGRES_DB:-tianpu_ems}"]
interval: 10s
timeout: 5s
retries: 5
restart: always
deploy:
resources:
limits:
memory: 2G
cpus: '2.0'
reservations:
memory: 512M
cpus: '0.5'
logging:
driver: json-file
options:
max-size: "50m"
max-file: "5"
redis:
image: redis:7-alpine
container_name: tianpu_redis
command: redis-server --appendonly yes --maxmemory 256mb --maxmemory-policy allkeys-lru
volumes:
- redisdata:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
restart: always
deploy:
resources:
limits:
memory: 512M
cpus: '1.0'
reservations:
memory: 128M
cpus: '0.25'
logging:
driver: json-file
options:
max-size: "10m"
max-file: "3"
backend:
build:
context: ./backend
dockerfile: Dockerfile
container_name: tianpu_backend
env_file: .env
environment:
- DEBUG=false
expose:
- "8000"
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
command: >
gunicorn app.main:app
--workers 4
--worker-class uvicorn.workers.UvicornWorker
--bind 0.0.0.0:8000
--timeout 120
--access-logfile -
--error-logfile -
restart: always
healthcheck:
test: ["CMD", "curl", "-sf", "http://localhost:8000/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 30s
deploy:
resources:
limits:
memory: 1G
cpus: '2.0'
reservations:
memory: 256M
cpus: '0.5'
logging:
driver: json-file
options:
max-size: "50m"
max-file: "5"
volumes:
pgdata:
redisdata: