This repository has been archived by the owner on Mar 27, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 30
/
docker-compose.yml
245 lines (231 loc) · 5.2 KB
/
docker-compose.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
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
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
version: "3.7"
services:
postgres:
container_name: postgres
image: postgres:11.5
networks:
- main
ports:
- "5434:5432"
volumes:
- pg-data:/var/lib/postgresql/data
environment:
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- POSTGRES_USER=${POSTGRES_USERNAME}
- POSTGRES_DB=${POSTGRES_NAME}
redis:
image: redis:alpine
volumes:
- redis-data:/data
container_name: redis
networks:
- main
redis-commander:
container_name: redis-commander
hostname: redis-commander
image: rediscommander/redis-commander:latest
restart: always
environment:
- REDIS_HOST=redis
ports:
- "8085:8081"
depends_on:
- "redis"
networks:
- main
nginx:
container_name: nginx
build:
context: ./nginx
dockerfile: dev/Dockerfile
ports:
- "80:80"
depends_on:
- backend
- frontend
- flower
- asgiserver
volumes:
- ./nginx/dev/dev.conf:/etc/nginx/nginx.conf:ro
- django-static:/usr/src/app/static
networks:
- main
frontend:
container_name: frontend
build:
context: ./quasar
networks:
- main
ports:
- "8080:8080"
volumes:
- ./quasar:/app/:rw
depends_on:
- backend
- postgres
environment:
- CHOKIDAR_USEPOLLING=true
- GITHUB_KEY=${GITHUB_KEY}
- GOOGLE_OAUTH2_KEY=${GOOGLE_OAUTH2_KEY}
- FACEBOOK_KEY=${FACEBOOK_KEY}
- FULL_DOMAIN_NAME=${DOMAIN_NAME}
restart: "no"
backend: &backend
container_name: backend
build:
context: ./backend
dockerfile: scripts/dev/Dockerfile
command:
- "watchmedo"
- "auto-restart"
- "--directory=./"
- "--pattern=*.py"
- "--recursive"
- "--"
- "python3"
- "manage.py"
- "runserver_plus"
- "0.0.0.0:8000"
volumes:
- ./backend:/code
- django-static:/code/static
ports:
- "8000:8000"
- "8888:8888"
networks:
- main
environment:
- CI_PIPELINE_TRIGGERED=True
- SECRET_KEY=secret-key-for-development
- DEBUG=True
- DJANGO_EMAIL_HOST=${DJANGO_EMAIL_HOST}
- DJANGO_EMAIL_PORT=${DJANGO_EMAIL_PORT}
- POSTGRES_NAME=${POSTGRES_NAME}
- POSTGRES_USERNAME=${POSTGRES_USERNAME}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- POSTGRES_SERVICE_HOST=${POSTGRES_SERVICE_HOST}
- POSTGRES_SERVICE_PORT=${POSTGRES_SERVICE_PORT}
- CELERY_BROKER_URL=${CELERY_BROKER_URL}
- CELERY_RESULT_BACKEND=${CELERY_RESULT_BACKEND}
- DJANGO_SETTINGS_MODULE=backend.settings.development
- GITHUB_KEY=${GITHUB_KEY}
- GITHUB_SECRET=${GITHUB_SECRET}
- GOOGLE_OAUTH2_KEY=${GOOGLE_OAUTH2_KEY}
- GOOGLE_OAUTH2_SECRET=${GOOGLE_OAUTH2_SECRET}
- FACEBOOK_KEY=${FACEBOOK_KEY}
- FACEBOOK_SECRET=${FACEBOOK_SECRET}
- REDIS_SERVICE_HOST=redis
depends_on:
- postgres
- redis
asgiserver:
<<: *backend
container_name: asgiserver
build:
context: ./backend
dockerfile: scripts/dev/Dockerfile
command:
- "watchmedo"
- "auto-restart"
- "--directory=./"
- "--pattern=*.py"
- "--recursive"
- "--"
- "python3"
- "manage.py"
- "runserver"
- "0.0.0.0:9000"
volumes:
- ./backend:/code
ports: []
celery_default:
<<: *backend
container_name: celery_default
command:
- "watchmedo"
- "auto-restart"
- "--directory=./"
- "--pattern=*.py"
- "--recursive"
- "--"
- "celery"
- "--app=backend.celery_app:app"
- "worker"
- "-Q"
- "default"
- "--concurrency=1"
- "--loglevel=INFO"
volumes:
- ./backend:/code
ports: []
beat:
<<: *backend
build:
context: ./backend
dockerfile: scripts/dev/Dockerfile
container_name: beat
command:
- "sh"
- "-c"
- |
# remove celerybeat.pid and celerybeat-schedule if they exist
rm -f /code/celerybeat*;
watchmedo \
auto-restart \
--directory=./ \
--pattern=*.py \
--recursive \
-- \
celery \
--app=backend.celery_app:app \
beat \
--loglevel=INFO \
--pidfile=/code/celerybeat.pid
volumes:
- ./backend:/code
ports: []
flower:
image: mher/flower:0.9
container_name: flower
command: flower --url_prefix=flower
environment:
- CELERY_BROKER_URL=redis://redis:6379
- FLOWER_PORT=5555
ports:
- 5555:5555
networks:
- main
depends_on:
- redis
- beat
mailhog:
container_name: mailhog
image: mailhog/mailhog
ports:
- 1025:1025
- 8025:8025
networks:
- main
pgadmin:
container_name: pgadmin
image: dpage/pgadmin4
environment:
PGADMIN_DEFAULT_EMAIL: [email protected]
PGADMIN_DEFAULT_PASSWORD: admin
volumes:
- pgadmin:/root/.pgadmin
ports:
- "5050:80"
depends_on:
- "postgres"
networks:
- main
restart: unless-stopped
volumes:
pg-data:
django-static:
redis-data:
pgadmin:
networks:
main:
driver: bridge