-
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdocker-compose.dev.yml
More file actions
153 lines (146 loc) · 4.18 KB
/
docker-compose.dev.yml
File metadata and controls
153 lines (146 loc) · 4.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
# MultiWA Gateway V1.0.0 - Development Docker Compose
# All services run in Docker for consistent Prisma connectivity
services:
# ==============================================
# PostgreSQL Database
# ==============================================
postgres:
image: postgres:16-alpine
container_name: multiwa-postgres
restart: unless-stopped
environment:
POSTGRES_USER: multiwa
POSTGRES_PASSWORD: multiwa123
POSTGRES_DB: multiwa_gateway
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
networks:
- multiwa-network
healthcheck:
test: ["CMD-SHELL", "pg_isready -U multiwa -d multiwa_gateway"]
interval: 10s
timeout: 5s
retries: 5
# ==============================================
# Redis (Cache + Queue)
# ==============================================
redis:
image: redis:7-alpine
container_name: multiwa-redis
restart: unless-stopped
ports:
- "6379:6379"
volumes:
- redis_data:/data
networks:
- multiwa-network
command: redis-server --appendonly yes
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
# ==============================================
# MinIO (S3-compatible storage for media)
# ==============================================
minio:
image: minio/minio:latest
container_name: multiwa-minio
restart: unless-stopped
environment:
MINIO_ROOT_USER: minio
MINIO_ROOT_PASSWORD: minio123
ports:
- "9000:9000"
- "9001:9001"
volumes:
- minio_data:/data
networks:
- multiwa-network
command: server /data --console-address ":9001"
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"]
interval: 30s
timeout: 20s
retries: 3
# ==============================================
# API Service (NestJS with Chromium for whatsapp-web.js)
# ==============================================
api:
build:
context: .
dockerfile: docker/Dockerfile.api
container_name: multiwa-api
restart: unless-stopped
shm_size: '1gb'
working_dir: /app/apps/api
environment:
NODE_ENV: development
DATABASE_URL: postgresql://multiwa:multiwa123@postgres:5432/multiwa_gateway?schema=public
REDIS_URL: redis://redis:6379
API_PORT: 3333
API_HOST: 0.0.0.0
JWT_SECRET: dev-jwt-secret-change-in-production
CORS_ORIGINS: http://localhost:3001,http://admin:3001,http://localhost:3333
# S3/MinIO configuration for media uploads
S3_ENDPOINT: http://minio:9000
S3_PUBLIC_URL: http://localhost:9000
S3_ACCESS_KEY: minio
S3_SECRET_KEY: minio123
S3_BUCKET: multiwa-media
S3_REGION: us-east-1
# Puppeteer/Chromium configuration for whatsapp-web.js
PUPPETEER_EXECUTABLE_PATH: /usr/bin/chromium
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: "true"
SESSIONS_DIR: /data/sessions
ports:
- "3333:3333"
volumes:
- sessions_data:/data/sessions
networks:
- multiwa-network
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
command: ["node", "dist/main.js"]
healthcheck:
test: ["CMD", "wget", "-q", "--spider", "http://localhost:3333/api/docs"]
interval: 30s
timeout: 10s
retries: 3
start_period: 120s
# ==============================================
# Admin Dashboard (Next.js)
# ==============================================
admin:
image: node:20-alpine
container_name: multiwa-admin
restart: unless-stopped
working_dir: /app
environment:
NODE_ENV: development
NEXT_PUBLIC_API_URL: http://localhost:3333
INTERNAL_API_URL: http://api:3333
PORT: 3001
ports:
- "3001:3001"
volumes:
- ./:/app
- /app/node_modules
networks:
- multiwa-network
depends_on:
- api
command: sh -c "apk add --no-cache git && corepack enable && pnpm install && cd apps/admin && pnpm run dev"
networks:
multiwa-network:
driver: bridge
volumes:
postgres_data:
redis_data:
minio_data:
sessions_data: