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}
|
|
|
|
|
POSTGRES_PASSWORD: ${DB_PASS:-password}
|
|
|
|
|
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}
|
|
|
|
|
RABBITMQ_DEFAULT_PASS: ${DB_PASS:-password}
|
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-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-01-11 15:30:43 +00:00
|
|
|
- DATABASE_URL=postgres://${DB_USER:-veza}:${DB_PASS:-password}@postgres:5432/${DB_NAME:-veza}?sslmode=disable
|
|
|
|
|
- REDIS_URL=redis://redis:6379
|
|
|
|
|
- AMQP_URL=amqp://${DB_USER:-veza}:${DB_PASS:-password}@rabbitmq:5672
|
|
|
|
|
- JWT_SECRET=${JWT_SECRET:-change-me-in-production-minimum-32-characters}
|
|
|
|
|
- COOKIE_SECURE=true
|
|
|
|
|
- COOKIE_SAME_SITE=strict
|
|
|
|
|
- COOKIE_HTTP_ONLY=true
|
|
|
|
|
- CORS_ALLOWED_ORIGINS=${CORS_ORIGINS:-http://localhost}
|
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-01-11 15:30:43 +00:00
|
|
|
- DATABASE_URL=postgres://${DB_USER:-veza}:${DB_PASS:-password}@postgres:5432/${DB_NAME:-veza}?sslmode=disable
|
2026-01-03 21:59:48 +00:00
|
|
|
- REDIS_URL=redis://redis:6379
|
2026-01-11 15:30:43 +00:00
|
|
|
- JWT_SECRET=${JWT_SECRET:-change-me-in-production-minimum-32-characters}
|
|
|
|
|
- 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-01-11 15:30:43 +00:00
|
|
|
- DATABASE_URL=postgres://${DB_USER:-veza}:${DB_PASS:-password}@postgres:5432/${DB_NAME:-veza}?sslmode=disable
|
|
|
|
|
- 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
|
|
|
|
|
ports:
|
|
|
|
|
- "${PORT_HAPROXY:-80}:80"
|
|
|
|
|
- "443:443"
|
|
|
|
|
volumes:
|
|
|
|
|
- ./config/haproxy/haproxy.cfg:/usr/local/etc/haproxy/haproxy.cfg:ro
|
|
|
|
|
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:
|