-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
179 lines (168 loc) · 4.08 KB
/
Copy pathdocker-compose.yml
File metadata and controls
179 lines (168 loc) · 4.08 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
x-app-common: &app-common
image: digest-engine-app:dev
pull_policy: never
build:
context: .
dockerfile: docker/web/Dockerfile
env_file:
- .env
volumes:
- .:/app
x-shared-env: &shared-env
DATABASE_URL: postgresql://newsletter:newsletter@postgres:5432/digest_engine
RABBITMQ_URL: amqp://digest-engine:digest-engine@rabbitmq:5672/
REDIS_URL: redis://redis:6379/0
QDRANT_URL: http://qdrant:6333
services:
django:
<<: *app-common
environment:
BOOTSTRAP_APP: "true"
<<: *shared-env
command:
[
"gunicorn",
"digest_engine.wsgi:application",
"--bind",
"0.0.0.0:8000",
"--workers",
"2",
"--reload",
]
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
qdrant:
condition: service_started
healthcheck:
test: ["CMD", "python", "manage.py", "check"]
interval: 30s
timeout: 10s
retries: 5
taskiq-worker:
<<: *app-common
environment:
BOOTSTRAP_APP: "false"
<<: *shared-env
command:
[
"watchmedo",
"auto-restart",
"--directory=.",
"--pattern=*.py",
"--recursive",
"--",
"taskiq",
"worker",
"digest_engine.taskiq:broker",
"--fs-discover",
"--log-level",
"INFO",
]
depends_on:
postgres:
condition: service_healthy
rabbitmq:
condition: service_healthy
redis:
condition: service_healthy
qdrant:
condition: service_started
taskiq-scheduler:
<<: *app-common
environment:
BOOTSTRAP_APP: "false"
<<: *shared-env
command:
[
"sh",
"-lc",
'skip_flag=''''; if [ "$${TASKIQ_SCHEDULER_SKIP_FIRST_RUN:-true}" = "true" ]; then skip_flag=''--skip-first-run''; fi; exec watchmedo auto-restart --directory=. --pattern=*.py --recursive -- taskiq scheduler digest_engine.taskiq:scheduler --fs-discover --log-level INFO $${skip_flag}',
]
depends_on:
postgres:
condition: service_healthy
rabbitmq:
condition: service_healthy
redis:
condition: service_healthy
qdrant:
condition: service_started
postgres:
image: postgres:16
environment:
POSTGRES_DB: digest_engine
POSTGRES_USER: newsletter
POSTGRES_PASSWORD: newsletter
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U newsletter -d digest_engine"]
interval: 10s
timeout: 5s
retries: 5
redis:
image: redis:7-alpine
command: ["redis-server", "--save", "", "--appendonly", "no"]
volumes:
- redis_data:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
rabbitmq:
image: rabbitmq:3.13-alpine
environment:
RABBITMQ_DEFAULT_USER: digest-engine
RABBITMQ_DEFAULT_PASS: digest-engine
volumes:
- rabbitmq_data:/var/lib/rabbitmq
healthcheck:
test: ["CMD", "rabbitmq-diagnostics", "-q", "ping"]
interval: 10s
timeout: 5s
retries: 5
qdrant:
image: qdrant/qdrant:latest
volumes:
- qdrant_data:/qdrant/storage
nginx:
image: nginx:alpine
depends_on:
django:
condition: service_started
ports:
- "8080:80"
volumes:
- ./docker/nginx/default.conf:/etc/nginx/conf.d/default.conf:ro
frontend:
image: node:22-alpine
working_dir: /app/frontend
command:
[
"sh",
"-lc",
"npm install && npm run dev -- --hostname 0.0.0.0 --port 3000",
]
env_file:
- .env
environment:
NEWSLETTER_API_INTERNAL_URL: http://nginx
NEXT_TELEMETRY_DISABLED: "1"
depends_on:
nginx:
condition: service_started
ports:
- "3000:3000"
volumes:
- ./frontend:/app/frontend
- frontend_node_modules:/app/frontend/node_modules
volumes:
postgres_data:
redis_data:
rabbitmq_data:
qdrant_data:
frontend_node_modules: