-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
executable file
·210 lines (195 loc) · 5.48 KB
/
Copy pathdocker-compose.yml
File metadata and controls
executable file
·210 lines (195 loc) · 5.48 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
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
x-logging: &default_logging
driver: json-file
options:
max-size: "10m"
max-file: "3"
x-app-env: &app_env
DEBUG: "false"
DATABASE_ECHO: "false"
DATABASE_HOST: ${DATABASE_HOST:-postgres}
DATABASE_PORT: ${DATABASE_PORT:-5432}
REDIS_HOST: ${REDIS_HOST:-redis}
REDIS_PORT: ${REDIS_PORT:-6379}
S3_ENDPOINT: ${S3_ENDPOINT:-http://minio:9000}
S3_REGION: ${S3_REGION:-us-east-1}
S3_BUCKET: ${S3_BUCKET:-app-bucket}
S3_USE_SSL: ${S3_USE_SSL:-false}
S3_PATH_STYLE: ${S3_PATH_STYLE:-true}
S3_PUBLIC_BASE_URL: ${S3_PUBLIC_BASE_URL:-http://localhost:9000/${S3_BUCKET:-app-bucket}}
S3_PRESIGN_TTL: ${S3_PRESIGN_TTL:-300}
x-app-common: &app_common
build:
context: .
dockerfile: Dockerfile
restart: unless-stopped
init: true
env_file:
- .env
environment:
<<: *app_env
networks:
- internal
logging: *default_logging
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
minio:
condition: service_healthy
minio-setup:
condition: service_completed_successfully
services:
postgres:
image: postgres:18.0-alpine
container_name: postgres_db
restart: unless-stopped
environment:
POSTGRES_USER: ${POSTGRES_USER:-admin}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-admin123}
POSTGRES_DB: ${POSTGRES_DB:-sampledb}
volumes:
- postgres_data:/var/lib/postgresql/data
- ./postgres_init:/docker-entrypoint-initdb.d:ro
healthcheck:
test: ["CMD-SHELL", "pg_isready -U $${POSTGRES_USER} -d $${POSTGRES_DB}"]
interval: 10s
timeout: 5s
retries: 10
networks:
- internal
logging: *default_logging
redis:
image: redis:7.2-alpine
container_name: redis
restart: unless-stopped
command: ["redis-server", "--appendonly", "yes"]
volumes:
- redis_data:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 3s
retries: 10
networks:
- internal
logging: *default_logging
minio:
image: minio/minio:latest
container_name: minio
restart: unless-stopped
environment:
MINIO_ROOT_USER: ${MINIO_ROOT_USER:-minioadmin}
MINIO_ROOT_PASSWORD: ${MINIO_ROOT_PASSWORD:-minioadmin}
command: server --console-address ":9001" /data
volumes:
- minio_data:/data
- minio_config:/root/.minio
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/ready"]
interval: 10s
timeout: 5s
retries: 10
networks:
- internal
logging: *default_logging
ports:
- "9000:9000"
- "127.0.0.1:9001:9001"
minio-setup:
image: minio/mc:latest
container_name: minio_setup
restart: "no"
network_mode: "service:minio"
env_file:
- .env
environment:
MINIO_ROOT_USER: ${MINIO_ROOT_USER:-minioadmin}
MINIO_ROOT_PASSWORD: ${MINIO_ROOT_PASSWORD:-minioadmin}
S3_BUCKET: ${S3_BUCKET:-app-bucket}
depends_on:
minio:
condition: service_healthy
entrypoint: >
sh -c "
mc alias set local http://localhost:9000 $${MINIO_ROOT_USER} $${MINIO_ROOT_PASSWORD} &&
mc mb -p local/$${S3_BUCKET} || true &&
mc anonymous set download local/$${S3_BUCKET} || true
"
evolution_api:
container_name: evolution_api
image: evoapicloud/evolution-api:latest
restart: unless-stopped
depends_on:
redis:
condition: service_healthy
postgres:
condition: service_healthy
networks:
- internal
logging: *default_logging
ports:
- "127.0.0.1:8080:8080"
volumes:
- evolution_instances:/evolution/instances
environment:
SERVER_TYPE: http
SERVER_PORT: 8080
SERVER_URL: ${EVOLUTION_SERVER_URL:-http://localhost:8080}
CORS_ORIGIN: "*"
CORS_METHODS: GET,POST,PUT,DELETE
CORS_CREDENTIALS: "true"
DATABASE_PROVIDER: postgresql
CACHE_REDIS_ENABLED: "true"
CACHE_REDIS_URI: redis://redis:6379/6
DATABASE_CONNECTION_URI: ${EVOLUTION_DATABASE_URI:-postgresql://evo_user:evo_pass@postgres:5432/evo_db?schema=public}
rabbitmq:
image: rabbitmq:3.13-management-alpine
container_name: rabbitmq
restart: unless-stopped
volumes:
- rabbitmq_data:/var/lib/rabbitmq
healthcheck:
test: ["CMD", "rabbitmq-diagnostics", "-q", "ping"]
interval: 10s
timeout: 5s
retries: 10
networks:
- internal
logging: *default_logging
environment:
RABBITMQ_DEFAULT_USER: ${RABBITMQ_USER:-guest}
RABBITMQ_DEFAULT_PASS: ${RABBITMQ_PASS:-guest}
backend:
<<: *app_common
container_name: app_backend
ports:
- "127.0.0.1:8000:8000"
command: ["uv", "run", "uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000", "--workers", "${WEB_CONCURRENCY:-2}"]
worker_dispatch_outbox_events:
<<: *app_common
container_name: worker_dispatch_outbox_events
command:
[
"uv", "run", "python", "-m", "app.workers",
"--job", "dispatch_outbox_events",
"--interval", "${DISPATCH_OUTBOX_EVENTS_INTERVAL_SECONDS:-2}",
"--batch-size", "${DISPATCH_OUTBOX_EVENTS_BATCH_SIZE:-50}"
]
rabbitmq_consumer:
<<: *app_common
container_name: rabbitmq_consumer
command: ["uv", "run", "python", "-m", "app.consumer"]
depends_on:
rabbitmq:
condition: service_healthy
networks:
internal:
driver: bridge
volumes:
postgres_data:
redis_data:
minio_data:
minio_config:
evolution_instances:
rabbitmq_data: