-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
153 lines (135 loc) · 4.19 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
version: '3.8'
services:
postgres:
container_name: postgres
image: postgres
restart: always
volumes:
- postgres_data:/var/lib/postgresql/data/
environment:
POSTGRES_DB: ${POSTGRES_DB}
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
ports:
- 5432:5432
networks:
- back
redis:
container_name: redis
image: redis
restart: unless-stopped
command: redis-server /usr/local/etc/redis/redis.conf
volumes:
- ./redis/redis.conf:/usr/local/etc/redis/redis.conf
ports:
- 6379:6379
networks:
- back
# rabbitmq:
# container_name: rabbitmq
# image: rabbitmq
# restart: unless-stopped
# volumes:
# - rabbitmq_data:/var/lib/rabbitmq
# - rabbitmq_log:/var/log/rabbitmq
# environment:
# RABBITMQ_DEFAULT_USER: ${RABBITMQ_DEFAULT_USER}
# RABBITMQ_DEFAULT_PASS: ${RABBITMQ_DEFAULT_PASS}
# ports:
# - 5672:5672
# - 15672:15672
# networks:
# - back
wsgiserver:
container_name: wsgiserver
build:
context: ./
# для продакшена можно указать отдельный Dockerfile с расширением prod
# dockerfile: Dockerfile.prod
entrypoint: ./docker/backend/wsgiserver-entrypoint.sh
# command: >
# sh -c "echo '>>> EXECUTION wsgiserver command' &&
# python manage.py collectstatic --noinput &&
# python manage.py makemigrations --noinput &&
# python manage.py migrate --noinput &&
# python manage.py runserver 0.0.0.0:8000"
volumes:
- static_volume:/app/static
- media_volume:/app/media
- .:/app # автоматическая перезагрузка wsgiserver при изменении файлов
env_file:
- ./.env
ports:
- 8000:8000
depends_on:
- postgres
- redis
# - rabbitmq
networks:
- front
- back
celery-worker:
container_name: celery-worker
build: ./
entrypoint: ./docker/backend/celery-worker-entrypoint.sh
volumes:
- /var/log/celery:/var/run/celery
# автоматическая перезагрузка celery-worker при изменении файлов
# (необходимо для работы runcelery/watchfiles)
# - .:/app
environment:
CELERY_APP: ${CELERY_APP}
REDIS_HOST: ${REDIS_HOST}
depends_on:
- postgres
- redis
# - rabbitmq
networks:
- back
celery-beat:
container_name: celery-beat
build: ./
entrypoint: ./docker/backend/celery-beat-entrypoint.sh
volumes:
- /var/log/celery:/var/run/celery
environment:
CELERY_APP: ${CELERY_APP}
POSTGRES_DB: ${POSTGRES_DB}
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_HOST: ${POSTGRES_HOST}
POSTGRES_PORT: ${POSTGRES_PORT}
depends_on:
- postgres
- redis
# - rabbitmq
networks:
- back
celery-flower:
container_name: celery-flower
build: ./
entrypoint: ./docker/backend/celery-flower-entrypoint.sh
volumes:
- /var/log/celery:/var/run/celery
environment:
CELERY_APP: ${CELERY_APP}
CELERY_FLOWER_URL_PREFIX: ${CELERY_FLOWER_URL_PREFIX}
CELERY_FLOWER_ADDRESS: ${CELERY_FLOWER_ADDRESS}
CELERY_FLOWER_PORT: ${CELERY_FLOWER_PORT}
ports:
- 5555:5555
depends_on:
- postgres
- redis
# - rabbitmq
networks:
- back
volumes:
postgres_data:
# rabbitmq_data:
# rabbitmq_log:
static_volume:
media_volume:
networks:
front:
back: