-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
53 lines (49 loc) · 1.19 KB
/
docker-compose.yml
File metadata and controls
53 lines (49 loc) · 1.19 KB
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
version: "3"
services:
db:
image: postgres:10-alpine
container_name: opl_postgres
env_file:
- config/env/db_env
networks:
- db_network
volumes:
- postgres_data:/var/lib/postgresql/data/
web:
container_name: opl_django
build: .
env_file:
- config/env/web_env
volumes:
- ./opl:/code/
- ./logs:/logs/
depends_on:
- db
networks:
- db_network
- nginx_network
restart: always
command: bash -c "python manage.py makemigrations && python manage.py migrate && python manage.py collectstatic --noinput && gunicorn opl.wsgi -w 4 -b 0.0.0.0:8000 --reload --access-logfile /logs/gunicorn-access.log --error-logfile /logs/gunicorn-error.log"
nginx:
container_name: opl_nginx
image: nginx:1.13-alpine
ports:
# 5000->Static(React), 8000->gunicorn(Django/HTTP)
- 5000:80
- 8000:90
volumes:
- ./config/nginx/conf.d:/etc/nginx/conf.d
- ./opl:/code/
- ./logs:/logs/
- ./frontend:/frontend/
depends_on:
- web
networks:
- nginx_network
networks:
nginx_network:
driver: bridge
db_network:
driver: bridge
volumes:
postgres_data: