services: # PostgreSQL - Primary Database # Limit: 256MB RAM. Sufficient for local dev schemas. # Port 15432 avoids conflict with other projects using default 5432 postgres: image: postgres:16-alpine container_name: veza_postgres restart: unless-stopped environment: POSTGRES_USER: ${POSTGRES_USER:-veza} # Use .env for real values; default is for local dev only POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-devpassword} POSTGRES_DB: ${POSTGRES_DB:-veza} ports: - "${PORT_POSTGRES:-15432}:5432" volumes: - postgres_data:/var/lib/postgresql/data healthcheck: test: [ "CMD-SHELL", "pg_isready -U veza" ] interval: 5s timeout: 5s retries: 5 networks: - veza-net deploy: resources: limits: cpus: '0.50' memory: 256M reservations: memory: 128M # Redis - Cache & PubSub # Limit: 64MB RAM. Port 16379 avoids conflict with other projects (default 6379) redis: image: redis:7-alpine container_name: veza_redis restart: unless-stopped ports: - "${PORT_REDIS:-16379}:6379" volumes: - redis_data:/data healthcheck: test: [ "CMD", "redis-cli", "ping" ] interval: 5s timeout: 3s retries: 5 networks: - veza-net deploy: resources: limits: cpus: '0.25' memory: 64M reservations: memory: 32M # ClamAV - Virus scanning for uploads (v0.101) clamav: image: clamav/clamav:latest container_name: veza_clamav restart: unless-stopped ports: - "${PORT_CLAMAV:-13310}:3310" networks: - veza-net healthcheck: test: ["CMD", "clamdscan", "--ping", "1"] interval: 30s timeout: 10s retries: 5 start_period: 180s deploy: resources: limits: cpus: '0.5' memory: 1G # RabbitMQ - Message Broker # Limit: 256MB RAM. Host 15672->AMQP(5672), 25672->Management(15672) rabbitmq: image: rabbitmq:3-management-alpine container_name: veza_rabbitmq restart: unless-stopped environment: RABBITMQ_DEFAULT_USER: ${RABBITMQ_DEFAULT_USER:-veza} # Use .env for real values; default is for local dev only RABBITMQ_DEFAULT_PASS: ${RABBITMQ_DEFAULT_PASS:-devpassword} ports: - "${PORT_RABBITMQ_AMQP:-15672}:5672" # AMQP (messaging) - "${PORT_RABBITMQ_MGMT:-25672}:15672" # Management UI volumes: - rabbitmq_data:/var/lib/rabbitmq healthcheck: test: rabbitmq-diagnostics -q ping interval: 5s timeout: 5s retries: 10 start_period: 40s networks: - veza-net deploy: resources: limits: cpus: '0.50' memory: 512M reservations: memory: 256M # Hyperswitch - Payment router (optional, for payment integration) 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_PASSWORD:-hyperswitch_dev} 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-net deploy: resources: limits: cpus: "0.25" memory: 128M profiles: - payments 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_PASSWORD:-hyperswitch_dev}@hyperswitch_postgres:5432/${HYPERSWITCH_DB_NAME:-hyperswitch}?sslmode=disable REDIS_URL: redis://redis:6379 ports: - "${PORT_HYPERSWITCH:-18081}:8080" depends_on: hyperswitch_postgres: condition: service_healthy redis: condition: service_healthy networks: - veza-net healthcheck: test: ["CMD", "wget", "--quiet", "--tries=1", "--spider", "http://localhost:8080/health"] interval: 10s timeout: 5s retries: 3 profiles: - payments # Backend API (Docker dev) backend-api: build: context: ./veza-backend-api container_name: veza_backend_dev environment: - APP_ENV=development - DATABASE_URL=postgresql://${POSTGRES_USER:-veza}:${POSTGRES_PASSWORD:-devpassword}@postgres:5432/${POSTGRES_DB:-veza}?sslmode=disable - REDIS_URL=redis://redis:6379 - JWT_SECRET=${JWT_SECRET:-dev-secret-key-minimum-32-characters-long} - COOKIE_SECURE=false # false en dev local - COOKIE_SAME_SITE=lax - COOKIE_DOMAIN= - COOKIE_HTTP_ONLY=true - COOKIE_PATH=/ - CORS_ALLOWED_ORIGINS=http://veza.fr:3000,http://veza.fr:5173 - RABBITMQ_URL=amqp://${RABBITMQ_DEFAULT_USER:-veza}:${RABBITMQ_DEFAULT_PASS:-devpassword}@rabbitmq:5672/ - ENABLE_CLAMAV=true - CLAMAV_REQUIRED=false - CLAMAV_ADDRESS=clamav:3310 ports: - "${PORT_BACKEND:-18080}:8080" depends_on: postgres: condition: service_healthy redis: condition: service_healthy rabbitmq: condition: service_healthy clamav: condition: service_started networks: - veza-net healthcheck: test: ["CMD", "curl", "-f", "http://localhost:8080/api/v1/health"] interval: 10s timeout: 5s retries: 5 # Chat Server (Rust) - v0.101 chat-server: build: context: . dockerfile: veza-chat-server/Dockerfile container_name: veza_chat_dev environment: - DATABASE_URL=postgresql://${POSTGRES_USER:-veza}:${POSTGRES_PASSWORD:-devpassword}@postgres:5432/${POSTGRES_DB:-veza}?sslmode=disable - REDIS_URL=redis://redis:6379 - JWT_SECRET=${JWT_SECRET:-dev-secret-key-minimum-32-characters-long} - CHAT_SERVER_PORT=3000 - CHAT_SERVER_HOST=0.0.0.0 ports: - "${PORT_CHAT:-18081}:3000" depends_on: postgres: condition: service_healthy redis: condition: service_healthy networks: - veza-net healthcheck: test: ["CMD", "wget", "--quiet", "--tries=1", "--spider", "http://localhost:3000/health"] interval: 10s timeout: 5s retries: 5 # Stream Server (Rust) - v0.101 stream-server: build: context: . dockerfile: veza-stream-server/Dockerfile container_name: veza_stream_dev environment: - DATABASE_URL=postgresql://${POSTGRES_USER:-veza}:${POSTGRES_PASSWORD:-devpassword}@postgres:5432/${POSTGRES_DB:-veza}?sslmode=disable - REDIS_URL=redis://redis:6379 - JWT_SECRET=${JWT_SECRET:-dev-secret-key-minimum-32-characters-long} - SECRET_KEY=${JWT_SECRET:-dev-secret-key-minimum-32-characters-long} - PORT=3001 ports: - "${PORT_STREAM:-18082}:3001" depends_on: postgres: condition: service_healthy redis: condition: service_healthy networks: - veza-net healthcheck: test: ["CMD", "wget", "--quiet", "--tries=1", "--spider", "http://localhost:3001/health"] interval: 10s timeout: 5s retries: 5 volumes: postgres_data: redis_data: rabbitmq_data: hyperswitch_postgres_data: networks: veza-net: driver: bridge