-
Notifications
You must be signed in to change notification settings - Fork 2
/
development-docker-compose.yml
127 lines (116 loc) · 2.99 KB
/
development-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
version: '3.5'
networks:
backend_net:
name: bridge_between_frontend_backend
driver: bridge
ipam:
driver: default
config:
- subnet: 192.168.96.0/20
gateway: 192.168.96.1
services:
backend_sl:
# The "_" is not allowed in the HOST name as per RFC 1034/1035
# and that was what was causing the Invalid HTTP_HOST header
# so replace it with '-'
# for use this container in the frontend
container_name: backend-sl
command: python manage.py runserver 0.0.0.0:6123
build:
context: ./backend_sl # but the source path that we will search about docker image from it
dockerfile: development.Dockerfile
restart: always
env_file:
- .env
environment:
- DJANGO_SETTINGS_MODULE=backend_sl.settings.development
- DEBUG=True
ports:
- "6123:6123"
volumes:
- ./backend_sl/:/usr/src/backend_sl/
- static_vol:/app/static # /app: workdir that we created in docker image and move our files in it
- media_vol:/app/media
networks:
- backend_net
depends_on:
- redis
# this don't work with version 3.5 maybe work on version 2
# networks:
# backend_net:
# - ipv4_address: 192.168.96.2
redis:
container_name: redis-server-api
image: redis:alpine
restart: always
ports:
- '6379:6379'
networks:
- backend_net
expose:
- 6379
celery_worker:
container_name: backend_sl_celery_worker
restart: always
build:
context: ./backend_sl
dockerfile: development.Dockerfile
command: celery -A backend_sl worker --loglevel=info --logfile=logs/celery.log
volumes:
- ./backend_sl/:/usr/src/backend_sl/
env_file:
- .env
environment:
- DJANGO_SETTINGS_MODULE=backend_sl.settings.development
- DEBUG=True
depends_on:
- redis
- backend_sl
networks:
- backend_net
celery_beat:
container_name: backend_sl_celery_beat
restart: always
build:
context: ./backend_sl
dockerfile: development.Dockerfile
command: celery -A backend_sl beat -l info
volumes:
- ./backend_sl/:/usr/src/backend_sl/
env_file:
- .env
environment:
- DJANGO_SETTINGS_MODULE=backend_sl.settings.development
- DEBUG=True
depends_on:
- redis
- backend_sl
networks:
- backend_net
flower:
container_name: backend_sl_flower
restart: always
build:
context: ./backend_sl
dockerfile: development.Dockerfile
command: "celery -A backend_sl flower
--broker=redis://redis:6379//
--env-file=.env
--basic_auth=${FLOWER_USER}:${FLOWER_PASSWORD}"
ports:
- '5555:5555'
env_file:
- .env
environment:
- DJANGO_SETTINGS_MODULE=backend_sl.settings.development
- DEBUG=True
depends_on:
- backend_sl
- redis
- celery_worker
- celery_beat
networks:
- backend_net
volumes:
static_vol:
media_vol: