-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
63 lines (58 loc) · 1.4 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
# https://pawamoy.github.io/posts/docker-compose-django-postgres-nginx/
#
# Commands:
# sudo docker-compose build
# sudo docker-compose up
# sudo docker-compose run --rm djangoapp /bin/bash -c "cd wardbulletin; ./manage.py migrate"
# sudo docker-compose run djangoapp wardbulletin/manage.py collectstatic --no-input
#
########################################################################
version: '3'
services:
djangoapp:
build:
context: .
dockerfile: ./Dockerfile-prod
restart: always
ports:
- 8200:8000
volumes:
- .:/opt/services/djangoapp/src
- static_volume:/opt/services/djangoapp/static
- media_volume:/opt/services/djangoapp/media
networks:
- nginx_network
- mysql_network
depends_on:
- mysql
nginx:
image: nginx
restart: always
ports:
- 8280:80
volumes:
- ./docker_config/nginx/conf.d:/etc/nginx/conf.d
- static_volume:/opt/services/djangoapp/static
- media_volume:/opt/services/djangoapp/media
depends_on:
- djangoapp
networks:
- nginx_network
mysql:
image: mariadb
restart: always
env_file:
- docker_config/db/mysql_env
networks:
- mysql_network
volumes:
- mysql_volume:/var/lib/mysql
networks:
nginx_network:
driver: bridge
mysql_network:
driver: bridge
volumes:
mysql_volume:
static_volume:
media_volume: