-
Notifications
You must be signed in to change notification settings - Fork 16
/
docker-compose.yml
104 lines (97 loc) · 2.15 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
version: "2"
services:
web:
restart: always
build: ./backend
image: webworkerimage
working_dir: /usr/src/app
expose:
- "8000"
links:
- redis:redis
- celeryworker:celeryworker
- celerybeat:celerybeat
volumes:
- ./backend:/usr/src/app
- ./backups:/usr/src/backups
- /usr/src/app/static
- mediadata:/usr/src/app/media
env_file: .env
environment:
VIRTUAL_HOST: 'backend'
command: /usr/local/bin/gunicorn backend.wsgi:application -w 4 -b 0.0.0.0:8000 --reload --log-level debug
stdin_open: true
tty: true
networks:
- api-tier
- back-tier
nginx:
restart: always
build: ./nginx
container_name: poap-fun-nginx
ports:
- "80:80"
- "443:443"
volumes:
- ./nginx/sites-enabled:/etc/nginx
- /var/run/docker.sock:/tmp/docker.sock:ro
volumes_from:
- web
depends_on:
- web
links:
- web
networks:
- api-tier
redis:
restart: always
image: redis:latest
container_name: poap-fun-redis
ports:
- "6382:6379"
volumes:
- redisdata:/data
networks:
- back-tier
celeryworker:
restart: always
build: ./backend
image: webworkerimage
working_dir: /usr/src/app
command: celery worker --app=backend --maxtasksperchild 10 -E --loglevel=INFO
container_name: poap-fun-celeryworker
volumes:
- mediadata:/usr/src/app/media
- ./backend:/usr/src/app
env_file: .env
environment:
C_FORCE_ROOT: 'yes'
depends_on:
- redis
networks:
- back-tier
celerybeat:
restart: always
build: ./backend
image: webworkerimage
working_dir: /usr/src/app
container_name: poap-fun-celerybeat
volumes:
- ./backend:/usr/src/app
- mediadata:/usr/src/app/media
env_file: .env
environment:
C_FORCE_ROOT: 'yes'
depends_on:
- redis
command: celery beat --app=backend -s /tmp/celerybeat-schedule --pidfile=/tmp/celery.pid --loglevel=INFO
networks:
- back-tier
volumes:
mediadata:
redisdata:
networks:
api-tier:
driver: bridge
back-tier:
driver: bridge