-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.prod.yml
76 lines (74 loc) · 2.02 KB
/
docker-compose.prod.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
74
75
76
# Deploy Version
version: '3.7'
services:
redis:
# 사용할 이미지
image: redis:latest
# 컨테이너명
container_name: redis
# 접근 포트 설정(컨테이너 외부:컨테이너 내부)
ports:
- 6379:6379
# 스토리지 마운트(볼륨) 설정
volumes:
# Server
- ./backend/data/redis/data:/data
- ./backend/data/redis/conf/redis.conf:/usr/local/conf/redis.conf
# 컨테이너에 docker label을 이용해서 메타데이터 추가
labels:
- "name=redis"
- "mode=standalone"
# 컨테이너 종료시 재시작 여부 설정
restart: always
command: redis-server /usr/local/conf/redis.conf
networks:
- witches_prod
nginx:
image: nginx:latest
container_name: nginx
ports:
- "80:80"
volumes:
# Server
- './backend/data/nginx/conf.d:/etc/nginx/conf.d'
- './backend/data/nginx/nginx.conf:/etc/nginx/nginx.conf'
- './backend/data/nginx/html:/usr/share/nginx/html'
- './backend/data/nginx/logs:/var/log/nginx'
restart: always
networks:
- witches_prod
node-exporter:
image: prom/node-exporter:latest
container_name: node-exporter
restart: unless-stopped
volumes:
- /proc:/host/proc:ro
- /sys:/host/sys:ro
- /:/rootfs:ro
command:
- '--path.procfs=/host/proc'
- '--path.rootfs=/rootfs'
- '--path.sysfs=/host/sys'
- '--collector.filesystem.mount-points-exclude=^/(sys|proc|dev|host|etc)($$|/)'
ports:
- 9100:9100
networks:
- witches_prod
api:
# image: ghkd110/api:latest
build:
context: backend/data/django_project
dockerfile: Dockerfile
container_name: api
command: >
sh -c "python manage.py makemigrations &&
python manage.py migrate &&
gunicorn --bind 0:5000 config.wsgi:application"
ports:
- "5000:5000"
networks:
- witches_prod
restart: always
networks:
witches_prod:
driver: bridge