2026-01-11 15:30:43 +00:00
version : '3.8'
2026-01-03 21:59:48 +00:00
2026-01-11 15:30:43 +00:00
services :
# ============================================================================
# INFRASTRUCTURE SERVICES
# ============================================================================
2026-01-03 21:59:48 +00:00
postgres :
image : postgres:16-alpine
2026-01-11 15:30:43 +00:00
container_name : veza_postgres
2026-01-03 21:59:48 +00:00
restart : unless-stopped
environment :
2026-01-11 15:30:43 +00:00
POSTGRES_USER : ${DB_USER:-veza}
2026-02-11 21:43:09 +00:00
POSTGRES_PASSWORD : ${DB_PASS:?DB_PASS must be set for production}
2026-01-11 15:30:43 +00:00
POSTGRES_DB : ${DB_NAME:-veza}
2026-01-03 21:59:48 +00:00
volumes :
2026-01-11 15:30:43 +00:00
- postgres_data:/var/lib/postgresql/data
2026-01-03 21:59:48 +00:00
healthcheck :
2026-01-11 15:30:43 +00:00
test : [ "CMD-SHELL" , "pg_isready -U ${DB_USER:-veza}" ]
interval : 5s
2026-01-03 21:59:48 +00:00
timeout : 5s
retries : 5
2026-01-11 15:30:43 +00:00
networks :
- veza-network
deploy :
resources :
limits :
cpus : '0.50'
memory : 256M
2026-01-03 21:59:48 +00:00
redis :
image : redis:7-alpine
2026-01-11 15:30:43 +00:00
container_name : veza_redis
2026-01-03 21:59:48 +00:00
restart : unless-stopped
volumes :
2026-01-11 15:30:43 +00:00
- redis_data:/data
2026-01-03 21:59:48 +00:00
healthcheck :
2026-01-11 15:30:43 +00:00
test : [ "CMD" , "redis-cli" , "ping" ]
interval : 5s
timeout : 3s
retries : 5
networks :
- veza-network
deploy :
resources :
limits :
cpus : '0.25'
memory : 64M
2026-01-03 21:59:48 +00:00
rabbitmq :
image : rabbitmq:3-management-alpine
2026-01-11 15:30:43 +00:00
container_name : veza_rabbitmq
2026-01-03 21:59:48 +00:00
restart : unless-stopped
environment :
2026-01-11 15:30:43 +00:00
RABBITMQ_DEFAULT_USER : ${DB_USER:-veza}
2026-02-11 21:43:09 +00:00
RABBITMQ_DEFAULT_PASS : ${RABBITMQ_PASS:?RABBITMQ_PASS must be set for production}
2026-01-03 21:59:48 +00:00
volumes :
2026-01-11 15:30:43 +00:00
- rabbitmq_data:/var/lib/rabbitmq
2026-01-03 21:59:48 +00:00
healthcheck :
test : rabbitmq-diagnostics -q ping
2026-01-11 15:30:43 +00:00
interval : 10s
timeout : 10s
retries : 5
networks :
- veza-network
2026-01-03 21:59:48 +00:00
deploy :
resources :
limits :
2026-01-11 15:30:43 +00:00
cpus : '0.50'
memory : 256M
2026-01-03 21:59:48 +00:00
2026-02-14 20:45:15 +00:00
# ============================================================================
# PAYMENT ROUTER (Hyperswitch)
# ============================================================================
hyperswitch_postgres :
image : postgres:16-alpine
container_name : veza_hyperswitch_postgres
restart : unless-stopped
environment :
POSTGRES_USER : ${HYPERSWITCH_DB_USER:-hyperswitch}
POSTGRES_PASSWORD : ${HYPERSWITCH_DB_PASS:?HYPERSWITCH_DB_PASS must be set for production}
POSTGRES_DB : ${HYPERSWITCH_DB_NAME:-hyperswitch}
volumes :
- hyperswitch_postgres_data:/var/lib/postgresql/data
healthcheck :
test : [ "CMD-SHELL" , "pg_isready -U ${HYPERSWITCH_DB_USER:-hyperswitch}" ]
interval : 5s
timeout : 5s
retries : 5
networks :
- veza-network
deploy :
resources :
limits :
cpus : "0.25"
memory : 128M
hyperswitch :
image : juspaydotin/hyperswitch-router:2025.01.21.0-standalone
container_name : veza_hyperswitch
restart : unless-stopped
environment :
DATABASE_URL : postgresql://${HYPERSWITCH_DB_USER:-hyperswitch}:${HYPERSWITCH_DB_PASS:?HYPERSWITCH_DB_PASS must be set}@hyperswitch_postgres:5432/${HYPERSWITCH_DB_NAME:-hyperswitch}?sslmode=require
REDIS_URL : redis://redis:6379
depends_on :
hyperswitch_postgres :
condition : service_healthy
redis :
condition : service_healthy
networks :
- veza-network
healthcheck :
test : [ "CMD" , "wget" , "--quiet" , "--tries=1" , "--spider" , "http://localhost:8080/health" ]
interval : 10s
timeout : 5s
retries : 3
deploy :
resources :
limits :
cpus : "0.5"
memory : 256M
2026-01-11 15:30:43 +00:00
# ============================================================================
# APPLICATION SERVICES
# ============================================================================
backend-api :
2026-01-03 21:59:48 +00:00
build :
context : ./veza-backend-api
dockerfile : Dockerfile.production
2026-01-11 15:30:43 +00:00
image : veza-backend-api:latest
container_name : veza_backend_api
2026-01-03 21:59:48 +00:00
restart : unless-stopped
environment :
- APP_ENV=production
2026-02-11 21:43:09 +00:00
- DATABASE_URL=postgres://${DB_USER:-veza}:${DB_PASS:?DB_PASS must be set}@postgres:5432/${DB_NAME:-veza}?sslmode=require
2026-01-11 15:30:43 +00:00
- REDIS_URL=redis://redis:6379
2026-02-11 21:43:09 +00:00
- AMQP_URL=amqp://${DB_USER:-veza}:${RABBITMQ_PASS:?RABBITMQ_PASS must be set}@rabbitmq:5672
- JWT_SECRET=${JWT_SECRET:?JWT_SECRET must be set for production}
2026-01-11 15:30:43 +00:00
- COOKIE_SECURE=true
- COOKIE_SAME_SITE=strict
- COOKIE_HTTP_ONLY=true
2026-02-11 21:18:57 +00:00
- CORS_ALLOWED_ORIGINS=${CORS_ORIGINS:-http://veza.fr}
2026-02-14 20:45:15 +00:00
- HYPERSWITCH_URL=http://hyperswitch:8080
- HYPERSWITCH_API_KEY=${HYPERSWITCH_API_KEY:-}
- HYPERSWITCH_WEBHOOK_SECRET=${HYPERSWITCH_WEBHOOK_SECRET:-}
- HYPERSWITCH_ENABLED=${HYPERSWITCH_ENABLED:-false}
- CHECKOUT_SUCCESS_URL=${CHECKOUT_SUCCESS_URL:-https://veza.fr/purchases}
2026-01-03 21:59:48 +00:00
depends_on :
postgres :
condition : service_healthy
redis :
condition : service_healthy
rabbitmq :
condition : service_healthy
2026-01-11 15:30:43 +00:00
networks :
- veza-network
healthcheck :
test : [ "CMD" , "wget" , "--quiet" , "--tries=1" , "--spider" , "http://localhost:8080/api/v1/health" ]
interval : 10s
timeout : 5s
retries : 3
2026-01-03 21:59:48 +00:00
2026-01-11 15:30:43 +00:00
chat-server :
2026-01-03 21:59:48 +00:00
build :
context : ./veza-chat-server
dockerfile : Dockerfile.production
2026-01-11 15:30:43 +00:00
image : veza-chat-server:latest
container_name : veza_chat_server
2026-01-03 21:59:48 +00:00
restart : unless-stopped
environment :
2026-02-11 21:43:09 +00:00
- DATABASE_URL=postgres://${DB_USER:-veza}:${DB_PASS:?DB_PASS must be set}@postgres:5432/${DB_NAME:-veza}?sslmode=require
2026-01-03 21:59:48 +00:00
- REDIS_URL=redis://redis:6379
2026-02-11 21:43:09 +00:00
- JWT_SECRET=${JWT_SECRET:?JWT_SECRET must be set for production}
2026-01-11 15:30:43 +00:00
- PORT=3000
2026-01-03 21:59:48 +00:00
depends_on :
postgres :
condition : service_healthy
2026-01-11 15:30:43 +00:00
redis :
condition : service_healthy
networks :
- veza-network
healthcheck :
test : [ "CMD" , "wget" , "--quiet" , "--tries=1" , "--spider" , "http://localhost:3000/health" ]
interval : 10s
timeout : 5s
retries : 3
2026-01-03 21:59:48 +00:00
2026-01-11 15:30:43 +00:00
stream-server :
2026-01-03 21:59:48 +00:00
build :
context : ./veza-stream-server
dockerfile : Dockerfile.production
2026-01-11 15:30:43 +00:00
image : veza-stream-server:latest
container_name : veza_stream_server
2026-01-03 21:59:48 +00:00
restart : unless-stopped
environment :
2026-02-11 21:43:09 +00:00
- DATABASE_URL=postgres://${DB_USER:-veza}:${DB_PASS:?DB_PASS must be set}@postgres:5432/${DB_NAME:-veza}?sslmode=require
2026-01-11 15:30:43 +00:00
- REDIS_URL=redis://redis:6379
- PORT=3001
2026-01-03 21:59:48 +00:00
depends_on :
postgres :
condition : service_healthy
2026-01-11 15:30:43 +00:00
redis :
2026-01-03 21:59:48 +00:00
condition : service_healthy
2026-01-11 15:30:43 +00:00
networks :
- veza-network
healthcheck :
test : [ "CMD" , "wget" , "--quiet" , "--tries=1" , "--spider" , "http://localhost:3001/health" ]
interval : 10s
timeout : 5s
retries : 3
2026-01-03 21:59:48 +00:00
2026-01-11 15:30:43 +00:00
web :
2026-01-03 21:59:48 +00:00
build :
context : ./apps/web
dockerfile : Dockerfile.production
2026-01-11 15:30:43 +00:00
image : veza-web:latest
container_name : veza_web
2026-01-03 21:59:48 +00:00
restart : unless-stopped
environment :
2026-01-11 15:30:43 +00:00
- VITE_API_URL=http://haproxy/api/v1
- VITE_WS_URL=ws://haproxy/ws
- VITE_STREAM_URL=ws://haproxy/stream
- VITE_UPLOAD_URL=http://haproxy/api/v1/uploads
2026-01-03 21:59:48 +00:00
depends_on :
2026-01-11 15:30:43 +00:00
- backend-api
- chat-server
- stream-server
networks :
- veza-network
healthcheck :
test : [ "CMD" , "wget" , "--quiet" , "--tries=1" , "--spider" , "http://localhost:5173" ]
interval : 10s
timeout : 5s
retries : 3
2026-01-03 21:59:48 +00:00
2026-01-11 15:30:43 +00:00
# ============================================================================
# REVERSE PROXY - HAProxy
# ============================================================================
haproxy :
image : haproxy:2.8-alpine
container_name : veza_haproxy
restart : unless-stopped
2026-02-15 14:58:51 +00:00
deploy :
resources :
limits :
cpus : '0.5'
memory : 128M
2026-01-11 15:30:43 +00:00
ports :
- "${PORT_HAPROXY:-80}:80"
- "443:443"
volumes :
- ./config/haproxy/haproxy.cfg:/usr/local/etc/haproxy/haproxy.cfg:ro
2026-02-15 14:58:51 +00:00
- ./config/ssl:/etc/ssl/veza:ro
2026-01-11 15:30:43 +00:00
depends_on :
- backend-api
- chat-server
- stream-server
- web
networks :
- veza-network
healthcheck :
test : [ "CMD" , "haproxy" , "-c" , "-f" , "/usr/local/etc/haproxy/haproxy.cfg" ]
interval : 10s
timeout : 5s
retries : 3
2026-01-03 21:59:48 +00:00
2026-01-11 15:30:43 +00:00
networks :
veza-network :
driver : bridge
ipam :
config :
- subnet : 172.20 .0 .0 /16
2026-01-03 21:59:48 +00:00
2026-01-11 15:30:43 +00:00
volumes :
postgres_data :
redis_data :
rabbitmq_data :
2026-02-14 20:45:15 +00:00
hyperswitch_postgres_data :