-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.prod.yml
176 lines (166 loc) · 4.16 KB
/
docker-compose.prod.yml
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
##
# This composer provides the self-contained environment for the Martini application, in "production" mode.
#
# It is based on the following services:
# - web: the Django application exposing the API and the admin interface.
# - web_nginx: the Nginx server, reverse proxying the Django application.
# - postgres: the PostgreSQL database, storing the application data from the Django app.
# - redis: the Redis server, used by Celery to store the tasks.
# - celery_worker: the Celery worker, executing the tasks (e.g. async document processing).
# - celery_beat: the Celery scheduler, scheduling the tasks.
# - celery_flower: the Celery Flower server, providing a web interface to monitor the Celery tasks.
# - qdrant: the Qdrant server, providing the vector search engine.
#
# The following volume is used:
# - static_volume: the volume storing the static files of the Django application, shared by the web and celery_worker services.
#
##
version: '3.8'
services:
web:
build:
context: .
dockerfile: iac/django/Dockerfile
image: martini_web
command: ./start.sh
environment:
- APP_ENV=production
- APP_SUPERUSER_NAME
- APP_SUPERUSER_PWD
- APP_SUPERUSER_EMAIL
- DATABASE_URL
- POSTGRES_DB
- POSTGRES_USER
- POSTGRES_PASSWORD
- POSTGRES_HOST
- POSTGRES_PORT
- CELERY_BROKER_URL
- CELERY_RESULT_BACKEND
- OPENAI_API_KEY
- QDRANT_URL
- EMBEDDINGS_DIMENSION_OPENAI
volumes:
- static_volume:/app/martini/static
restart: unless-stopped
ports:
- "8000:8000"
networks:
- martini_network
web_nginx:
build:
context: .
dockerfile: iac/django/Dockerfile.nginx
volumes:
- static_volume:/app/martini/static
restart: unless-stopped
ports:
- "8080:8080"
networks:
- martini_network
postgres:
image: postgres:14-alpine
volumes:
- postgres_data:/var/lib/postgres/data/
environment:
- POSTGRES_DB
- POSTGRES_USER
- POSTGRES_PASSWORD
- POSTGRES_HOST
healthcheck:
test: ["CMD", "pg_isready", "-U", "martini"]
interval: 10s
timeout: 5s
retries: 3
restart: unless-stopped
ports:
- "5432:5432"
networks:
- martini_network
redis:
image: redis:6-alpine
restart: unless-stopped
networks:
- martini_network
ports:
- 127.0.0.1:32787:6379
celery_worker:
build:
context: .
dockerfile: iac/django/Dockerfile
image: martini_worker
command: ./start-celery-worker.sh
volumes:
- static_volume:/app/martini/static
environment:
- APP_ENV=production
- CELERY_BROKER_URL
- CELERY_RESULT_BACKEND
- DATABASE_URL
- POSTGRES_DB
- POSTGRES_USER
- POSTGRES_PASSWORD
- POSTGRES_HOST
- POSTGRES_PORT
- QDRANT_URL
- OPENAI_API_KEY
- EMBEDDINGS_DIMENSION_OPENAI
restart: unless-stopped
networks:
- martini_network
celery_beat:
build:
context: .
dockerfile: iac/django/Dockerfile
image: martini_beat
command: ./start-celery-beat.sh
environment:
- APP_ENV=production
- CELERY_BROKER_URL
- CELERY_RESULT_BACKEND
- DATABASE_URL
- POSTGRES_DB
- POSTGRES_USER
- POSTGRES_PASSWORD
- POSTGRES_HOST
- POSTGRES_PORT
- OPENAI_API_KEY
- QDRANT_URL
restart: unless-stopped
networks:
- martini_network
celery_flower:
build:
context: .
dockerfile: iac/django/Dockerfile
image: martini_flower
command: ./start-celery-flower.sh
environment:
- APP_ENV=production
- CELERY_BROKER_URL
- CELERY_RESULT_BACKEND
- OPENAI_API_KEY
- DATABASE_URL
- POSTGRES_DB
- POSTGRES_USER
- POSTGRES_PASSWORD
- POSTGRES_HOST
- POSTGRES_PORT
- QDRANT_URL
restart: unless-stopped
ports:
- 5557:5555
networks:
- martini_network
qdrant:
image: qdrant/qdrant
restart: unless-stopped
ports:
- "6333:6333"
networks:
- martini_network
volumes:
static_volume:
postgres_data:
networks:
martini_network:
driver: bridge