-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
73 lines (67 loc) · 1.43 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
version: '3.2'
services:
redis:
image: redis:5
restart: always
command: redis-server --requirepass redispw
# ports:
# - 6379:6379
networks:
- back
db:
image: postgres:latest
restart: always
# ports:
# - 5432:5432
environment:
POSTGRES_PASSWORD: postgrespw
POSTGRES_DB: whatsapp
volumes:
- pgdata:/var/lib/postgresql/data
networks:
- back
api:
build:
context: ./backend
dockerfile: Dockerfile
image: "whatsapp_api:latest"
container_name: back
working_dir: /app/api
command: bash -c "python manage.py collectstatic --noinput && python manage.py migrate --noinput && daphne -b 0.0.0.0 -p 8000 whatsapp.asgi:application"
environment:
- DEBUG=off
- REDIS_URL=redis://default:redispw@redis:6379
- DATABASE_URL=postgres://postgres:postgrespw@db:5432/whatsapp
env_file:
- ./api.env
volumes:
- static:/app/api/static
networks:
- back
depends_on:
- redis
- db
restart: "always"
nginx:
restart: "always"
build:
context: .
dockerfile: ./nginx/Dockerfile
volumes:
- static:/app/api/static/
ports:
- 8080:8080
environment:
# - NGINX_HOST=example.com
- NGINX_PORT=8080
- DAPHNE_HOST=api
- DAPHNE_PORT=8000
depends_on:
- api
networks:
- back
volumes:
pgdata:
static:
networks:
back: