-
Notifications
You must be signed in to change notification settings - Fork 39
/
docker-compose.yml
184 lines (167 loc) · 3.38 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
version: "2.4"
services:
nginx:
container_name: nginx
build:
context: ./nginx
dockerfile: dev/Dockerfile
ports:
- "80:80"
depends_on:
- backend
volumes:
- ./nginx/dev/dev.conf:/etc/nginx/nginx.conf:ro
networks:
- main
postgres:
container_name: postgres
image: postgres:14
networks:
- main
ports:
- "5432:5432"
volumes:
- pg-data:/var/lib/postgresql/data
environment:
- POSTGRES_PASSWORD=postgres
pgadmin:
container_name: pgadmin
image: dpage/pgadmin4:8.3
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
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
backend: &backend
container_name: backend
build:
context: ./backend
target: local
command:
- "python3"
- "manage.py"
- "runserver"
- "0.0.0.0:8000"
volumes:
- ./backend:/code
ports:
- "8000:8000"
networks:
- main
environment:
- CELERY_TASK_ALWAYS_EAGER=${CELERY_TASK_ALWAYS_EAGER:-0}
- DJANGO_EMAIL_HOST=mailhog
- DEBUG=1
- POSTGRES_SERVICE_HOST=postgres
- REDIS_SERVICE_HOST=redis
- DJANGO_SETTINGS_MODULE=backend.settings.development
# celery beat
- PIDFILE=/code/celerybeat.pid
depends_on:
- postgres
- redis
celery_worker:
<<: *backend
container_name: celery_worker
command:
- "python3"
- "manage.py"
- "start_celery_worker"
ports: []
celery_beat:
<<: *backend
container_name: celery_beat
command:
- python3
- manage.py
- start_celery_beat
ports: []
# migrate command
migrate:
<<: *backend
container_name: migrate
command:
- python3
- manage.py
- migrate
ports: []
depends_on:
- postgres
- redis
- backend
restart: "on-failure"
# shell command - usefule for updating poetry
# shell:
# <<: *backend
# container_name: shell
# command: ["/bin/sh", "-c", "while true; do echo 'Container is alive...'; sleep 10; done"]
# # command: ["poetry", "lock"]
# ports: []
# depends_on:
# - postgres
# - redis
# - backend
# restart: "on-failure"
notebook:
<<: *backend
container_name: notebook
command:
- python3
- manage.py
- shell_plus
- --notebook
ports:
- "8888:8888"
mailhog:
container_name: mailhog
image: mailhog/mailhog
ports:
- 1025:1025
- 8025:8025
networks:
- main
flower:
container_name: flower
image: mher/flower
ports:
- "49555:5555"
networks:
- main
depends_on:
- celery_worker
environment:
- CELERY_BROKER_URL=redis://redis:6379/1
volumes:
pg-data:
redis-data:
pgadmin:
networks:
main:
driver: bridge