-
Notifications
You must be signed in to change notification settings - Fork 5
/
docker-compose_production.yml
65 lines (58 loc) · 1.27 KB
/
docker-compose_production.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
version: '2'
services:
django_app:
build: .
image: openclass:0.3
volumes:
- ./config/django/django_secret_key.txt:/etc/django_secret_key.txt
- migrations:/opt/OpenClass/openclass/migrations
- static_volume:/opt/OpenClass/static
- media_volume:/opt/OpenClass/media
networks:
- frontend
- backend_postgres
- backend_redis
depends_on:
- "db"
- "db_redis"
restart: on-failure
environment:
- PG_HOSTNAME=db
- DJANGO_SETTINGS_MODULE=OpenClassProject.settings.production
db:
image: postgres:alpine
environment:
- POSTGRES_PASSWORD=openclass
- POSTGRES_USER=openclass
volumes:
- pgdata:/var/lib/postgresql/data
networks:
- backend_postgres
db_redis:
image: redis:alpine
volumes:
- redis_data:/data
networks:
- backend_redis
nginx:
image: nginx:alpine
ports:
- 80:80
volumes:
- ./config/nginx/conf.d:/etc/nginx/conf.d
- static_volume:/opt/OpenClass/static
- media_volume:/opt/OpenClass/media
depends_on:
- django_app
networks:
- frontend
volumes:
migrations:
pgdata:
redis_data:
static_volume:
media_volume:
networks:
frontend:
backend_postgres:
backend_redis: