self-replicating/infra/docker/docker-compose.yml

149 lines
3.9 KiB
YAML

version: '3.8'
services:
# PostgreSQL Database
postgres:
image: postgres:15-alpine
container_name: srb-postgres
environment:
POSTGRES_USER: srb
POSTGRES_PASSWORD: srb_password
POSTGRES_DB: srb
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U srb"]
interval: 10s
timeout: 5s
retries: 5
networks:
- srb-network
# Redis for caching and queues
redis:
image: redis:7-alpine
container_name: srb-redis
ports:
- "6379:6379"
volumes:
- redis_data:/data
command: redis-server --appendonly yes
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
networks:
- srb-network
# n8n Workflow Automation
n8n:
image: n8nio/n8n:latest
container_name: srb-n8n
environment:
- N8N_BASIC_AUTH_ACTIVE=true
- N8N_BASIC_AUTH_USER=${N8N_BASIC_AUTH_USER:-admin}
- N8N_BASIC_AUTH_PASSWORD=${N8N_BASIC_AUTH_PASSWORD:-admin123}
- DB_TYPE=postgresdb
- DB_POSTGRESDB_HOST=postgres
- DB_POSTGRESDB_PORT=5432
- DB_POSTGRESDB_DATABASE=n8n
- DB_POSTGRESDB_USER=srb
- DB_POSTGRESDB_PASSWORD=srb_password
- N8N_PORT=5678
- WEBHOOK_URL=http://localhost:5678/
ports:
- "5678:5678"
volumes:
- n8n_data:/home/node/.n8n
- ../../packages/n8n-workflows:/workflows
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
networks:
- srb-network
# Orchestrator Service
orchestrator:
build:
context: ../../packages/orchestrator
dockerfile: ../../infra/docker/orchestrator.Dockerfile
container_name: srb-orchestrator
environment:
- DATABASE_URL=postgresql://srb:srb_password@postgres:5432/srb
- REDIS_URL=redis://redis:6379
- ANTHROPIC_API_KEY=${ANTHROPIC_API_KEY}
- FACEBOOK_APP_ID=${FACEBOOK_APP_ID}
- FACEBOOK_APP_SECRET=${FACEBOOK_APP_SECRET}
- FACEBOOK_ACCESS_TOKEN=${FACEBOOK_ACCESS_TOKEN}
- FACEBOOK_AD_ACCOUNT_ID=${FACEBOOK_AD_ACCOUNT_ID}
- GOOGLE_ADS_CLIENT_ID=${GOOGLE_ADS_CLIENT_ID}
- GOOGLE_ADS_CLIENT_SECRET=${GOOGLE_ADS_CLIENT_SECRET}
- GOOGLE_ADS_REFRESH_TOKEN=${GOOGLE_ADS_REFRESH_TOKEN}
- GOOGLE_ADS_DEVELOPER_TOKEN=${GOOGLE_ADS_DEVELOPER_TOKEN}
- GOOGLE_ADS_CUSTOMER_ID=${GOOGLE_ADS_CUSTOMER_ID}
- SENDGRID_API_KEY=${SENDGRID_API_KEY}
- SENDGRID_FROM_EMAIL=${SENDGRID_FROM_EMAIL}
- SENDGRID_FROM_NAME=${SENDGRID_FROM_NAME}
- VERCEL_TOKEN=${VERCEL_TOKEN}
- VERCEL_ORG_ID=${VERCEL_ORG_ID}
- ACQUIRE_COM_API_KEY=${ACQUIRE_COM_API_KEY}
- UPWORK_API_KEY=${UPWORK_API_KEY}
- SLACK_WEBHOOK_URL=${SLACK_WEBHOOK_URL}
- ALERT_EMAIL=${ALERT_EMAIL}
- NODE_ENV=${NODE_ENV:-development}
- PORT=3000
ports:
- "3000:3000"
volumes:
- ../../packages/orchestrator:/app
- /app/node_modules
- ../../data:/app/data
- ../../logs:/app/logs
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
networks:
- srb-network
restart: unless-stopped
# Web Dashboard (Next.js)
dashboard:
build:
context: ../../packages/web-dashboard
dockerfile: ../../infra/docker/dashboard.Dockerfile
container_name: srb-dashboard
environment:
- DATABASE_URL=postgresql://srb:srb_password@postgres:5432/srb
- NEXT_PUBLIC_API_URL=http://localhost:3000
ports:
- "3001:3000"
volumes:
- ../../packages/web-dashboard:/app
- /app/node_modules
- /app/.next
depends_on:
- postgres
- orchestrator
networks:
- srb-network
restart: unless-stopped
networks:
srb-network:
driver: bridge
volumes:
postgres_data:
driver: local
redis_data:
driver: local
n8n_data:
driver: local