-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
54 lines (51 loc) · 1.2 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
version: "3.7"
services:
nginx:
image: nginx:1.19.5
networks:
- network
volumes:
- /root/nginx.conf:/etc/nginx/nginx.conf
- /etc/letsencrypt:/etc/letsencrypt
- static-volume:/data/static
- media-volume:/data/media
ports:
- 80:80
# docker network 정책에 따라 각 컨테이너는 자신의 이름을 도메인으로 사용
django_container_gunicorn:
image: pinterest:7
networks:
- network
volumes:
- static-volume:/home/django-Pinterest/staticfiles
- media-volume:/home/django-Pinterest/media
secrets:
- MYSQL_PASSWORD
- DJANGO_SECRET_KEY
mariadb:
image: mariadb:10.5
networks:
- network
volumes:
- maria-database:/var/lib/mysql
secrets:
- MYSQL_PASSWORD
- MYSQL_ROOT_PASSWORD
environment:
MYSQL_DATABASE: django
MYSQL_USER: django
MYSQL_PASSWORD_FILE: /run/secrets/MYSQL_PASSWORD
MYSQL_ROOT_PASSWORD_FILE: /run/secrets/MYSQL_ROOT_PASSWORD
networks:
network:
volumes:
static-volume:
media-volume:
maria-database:
secrets:
DJANGO_SECRET_KEY:
external: true
MYSQL_PASSWORD:
external: true
MYSQL_ROOT_PASSWORD:
external: true