Files
boc/docker-compose.yml
T

94 lines
2.2 KiB
YAML
Raw Normal View History

version: '3.8'
services:
postgres:
image: postgres:16-alpine
container_name: boc-postgres
environment:
POSTGRES_USER: boc
POSTGRES_PASSWORD: ${DB_PASSWORD:-boc_secret_2026}
POSTGRES_DB: boc
volumes:
- postgres_data:/var/lib/postgresql/data
- ./backend/db/migrations:/docker-entrypoint-initdb.d:ro
ports:
- "5435:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U boc"]
interval: 5s
timeout: 5s
retries: 5
networks:
- boc-network
redis:
image: redis:7-alpine
container_name: boc-redis
command: redis-server --appendonly yes --maxmemory 256mb --maxmemory-policy allkeys-lru
volumes:
- redis_data:/data
ports:
- "6381:6379"
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 3s
retries: 5
networks:
- boc-network
boc-api:
build:
context: ./backend
dockerfile: Dockerfile
container_name: boc-api
environment:
PORT: "9092"
DB_URL: "postgres://boc:${DB_PASSWORD:-boc_secret_2026}@postgres:5432/boc?sslmode=disable"
JWT_SECRET: ${JWT_SECRET:?JWT_SECRET must be set}
AMOS_BASE_URL: "http://aamos-ledger:3250"
MIGRATIONS_DIR: "./db/migrations"
REDIS_URL: "redis://redis:6379"
RESEND_API_KEY: ${RESEND_API_KEY:-}
FROM_EMAIL: ${FROM_EMAIL:-noreply@landvex.com}
ports:
- "9096:9092"
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
volumes:
- ./backend/db/migrations:/app/db/migrations:ro
restart: unless-stopped
healthcheck:
test: ["CMD", "wget", "-q", "--spider", "http://localhost:9092/health"]
interval: 10s
timeout: 5s
retries: 3
networks:
- boc-network
nginx:
image: nginx:alpine
container_name: boc-nginx
ports:
- "80:80"
- "443:443"
volumes:
- ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro
- ./web:/usr/share/nginx/html:ro
depends_on:
- boc-api
restart: unless-stopped
networks:
- boc-network
volumes:
postgres_data:
redis_data:
networks:
boc-network:
driver: bridge