Edit: /opt/mawid/docker-compose.yml (2187B)
services:
postgres:
image: postgres:16-alpine
environment:
POSTGRES_USER: mawid
POSTGRES_PASSWORD: mawid
POSTGRES_DB: mawid
ports:
- '5432:5432'
volumes:
- pgdata:/var/lib/postgresql/data
healthcheck:
test: ['CMD-SHELL', 'pg_isready -U mawid -d mawid']
interval: 5s
timeout: 3s
retries: 10
redis:
image: redis:7-alpine
ports:
- '6379:6379'
healthcheck:
test: ['CMD', 'redis-cli', 'ping']
interval: 5s
timeout: 3s
retries: 10
api:
build:
context: .
dockerfile: apps/api/Dockerfile
environment:
NODE_ENV: development
API_PORT: 3001
DATABASE_URL: postgresql://mawid:mawid@postgres:5432/mawid
REDIS_URL: redis://redis:6379
JWT_SECRET: ${JWT_SECRET:-local-dev-secret-change-me}
OPENAI_API_KEY: ${OPENAI_API_KEY:-}
WA_PHONE_NUMBER_ID: ${WA_PHONE_NUMBER_ID:-}
WA_BUSINESS_ACCOUNT_ID: ${WA_BUSINESS_ACCOUNT_ID:-}
WA_ACCESS_TOKEN: ${WA_ACCESS_TOKEN:-}
WA_WEBHOOK_VERIFY_TOKEN: ${WA_WEBHOOK_VERIFY_TOKEN:-dev-verify-token}
WA_APP_SECRET: ${WA_APP_SECRET:-dev-app-secret}
APP_BASE_URL: http://localhost:3001
DASHBOARD_BASE_URL: http://localhost:3000
TZ: Europe/Istanbul
FEATURE_ECHO_MODE: ${FEATURE_ECHO_MODE:-false}
ports:
- '3001:3001'
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
healthcheck:
test:
['CMD', 'node', '-e', "fetch('http://localhost:3001/health').then(r => process.exit(r.ok ? 0 : 1), () => process.exit(1))"]
interval: 10s
timeout: 5s
retries: 10
start_period: 15s
dashboard:
build:
context: .
dockerfile: apps/dashboard/Dockerfile
environment:
NODE_ENV: production
PORT: 3000
ports:
- '3000:3000'
depends_on:
- api
healthcheck:
test:
['CMD', 'node', '-e', "fetch('http://localhost:3000').then(r => process.exit(r.ok ? 0 : 1), () => process.exit(1))"]
interval: 10s
timeout: 5s
retries: 10
start_period: 15s
volumes:
pgdata: