-
Notifications
You must be signed in to change notification settings - Fork 5
/
docker-compose.yml
81 lines (74 loc) · 1.63 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
# REF: https://testdriven.io/blog/dockerizing-django-with-postgres-gunicorn-and-nginx/
# To build, and deploy
# docker-compose up -d --build
# remove from local system
# docker system prune -a
version: '3.7'
services:
redis:
image: "redis:alpine"
volumes:
- redis_data:/data
backend:
build: .
command: gunicorn waterquality.wsgi:application --bind 0.0.0.0:8000
container_name: app
env_file:
- ./.env
environment:
- VIRTUAL_PORT=8000
volumes:
- static_volume:/app/static
- media_volume:/app/media
expose:
- 8000
depends_on:
- redis
celery-worker:
build: .
command: celery -A waterquality worker -l info
env_file:
- ./.env
depends_on:
- redis
celery-beat:
build: .
command: celery -A waterquality beat -l info --scheduler django_celery_beat.schedulers:DatabaseScheduler
env_file:
- ./.env
depends_on:
- redis
frontend:
build: ./frontend
volumes:
- ./frontend:/app
- node_modules:/app/node_modules
env_file:
- ./frontend/.env
environment:
- DANGEROUSLY_DISABLE_HOST_CHECK=true
- VIRTUAL_PORT=3000
expose:
- 3000
nginx-proxy:
container_name: nginx-proxy
build: nginx
restart: always
ports:
- 80:80
volumes:
- static_volume:/app/static
- media_volume:/app/media
- html:/usr/share/nginx/html
- vhost:/etc/nginx/vhost.d
- /var/run/docker.sock:/tmp/docker.sock:ro
depends_on:
- backend
- frontend
volumes:
static_volume:
media_volume:
html:
vhost:
redis_data:
node_modules: