feat: add Layer 1 foundation - Docker, WhatsApp Core, API Gateway, Frontend setup
- docker-compose.yml with PostgreSQL, Redis, all services - nginx/nginx.conf reverse proxy configuration - services/whatsapp-core: package.json, tsconfig.json, Dockerfile - services/api-gateway: requirements.txt, Dockerfile, app/__init__.py - frontend: package.json, tsconfig.json, vite.config.ts, index.html, Dockerfile, nginx.conf Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
104
docker-compose.yml
Normal file
104
docker-compose.yml
Normal file
@@ -0,0 +1,104 @@
|
||||
version: '3.8'
|
||||
|
||||
services:
|
||||
postgres:
|
||||
image: postgres:16-alpine
|
||||
container_name: wac_postgres
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
POSTGRES_DB: ${DB_NAME:-whatsapp_central}
|
||||
POSTGRES_USER: ${DB_USER:-whatsapp_admin}
|
||||
POSTGRES_PASSWORD: ${DB_PASSWORD:?DB_PASSWORD required}
|
||||
volumes:
|
||||
- postgres_data:/var/lib/postgresql/data
|
||||
ports:
|
||||
- "5432:5432"
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -U ${DB_USER:-whatsapp_admin}"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
networks:
|
||||
- wac_network
|
||||
|
||||
redis:
|
||||
image: redis:7-alpine
|
||||
container_name: wac_redis
|
||||
restart: unless-stopped
|
||||
command: redis-server --appendonly yes
|
||||
volumes:
|
||||
- redis_data:/data
|
||||
ports:
|
||||
- "6379:6379"
|
||||
healthcheck:
|
||||
test: ["CMD", "redis-cli", "ping"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
networks:
|
||||
- wac_network
|
||||
|
||||
whatsapp-core:
|
||||
build:
|
||||
context: ./services/whatsapp-core
|
||||
dockerfile: Dockerfile
|
||||
container_name: wac_whatsapp
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
NODE_ENV: ${NODE_ENV:-production}
|
||||
REDIS_URL: redis://redis:6379
|
||||
API_GATEWAY_URL: http://api-gateway:8000
|
||||
WS_PORT: 3001
|
||||
volumes:
|
||||
- whatsapp_sessions:/app/sessions
|
||||
ports:
|
||||
- "3001:3001"
|
||||
depends_on:
|
||||
redis:
|
||||
condition: service_healthy
|
||||
networks:
|
||||
- wac_network
|
||||
|
||||
api-gateway:
|
||||
build:
|
||||
context: ./services/api-gateway
|
||||
dockerfile: Dockerfile
|
||||
container_name: wac_api
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
DATABASE_URL: postgresql://${DB_USER:-whatsapp_admin}:${DB_PASSWORD}@postgres:5432/${DB_NAME:-whatsapp_central}
|
||||
REDIS_URL: redis://redis:6379
|
||||
JWT_SECRET: ${JWT_SECRET:?JWT_SECRET required}
|
||||
WHATSAPP_CORE_URL: http://whatsapp-core:3001
|
||||
CORS_ORIGINS: ${CORS_ORIGINS:-http://localhost:5173,http://localhost:3000}
|
||||
ports:
|
||||
- "8000:8000"
|
||||
depends_on:
|
||||
postgres:
|
||||
condition: service_healthy
|
||||
redis:
|
||||
condition: service_healthy
|
||||
networks:
|
||||
- wac_network
|
||||
|
||||
frontend:
|
||||
build:
|
||||
context: ./frontend
|
||||
dockerfile: Dockerfile
|
||||
container_name: wac_frontend
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "3000:80"
|
||||
depends_on:
|
||||
- api-gateway
|
||||
networks:
|
||||
- wac_network
|
||||
|
||||
volumes:
|
||||
postgres_data:
|
||||
redis_data:
|
||||
whatsapp_sessions:
|
||||
|
||||
networks:
|
||||
wac_network:
|
||||
driver: bridge
|
||||
Reference in New Issue
Block a user