-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.yml
95 lines (89 loc) · 2.25 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
# 개발용 docker-compose 파일
# 실행 방법: sudo docker compose up -d --build
version: "3.8"
services:
db:
container_name: mysql
image: mysql:8.0
env_file:
- .env
environment:
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD} # .env 파일에서 가져옴
MYSQL_DATABASE: ${MYSQL_DATABASE} # .env 파일에서 가져옴
MYSQL_USER: ${MYSQL_USER} # .env 파일에서 가져옴
MYSQL_PASSWORD: ${MYSQL_PASSWORD} # .env 파일에서 가져옴
ports:
- "3307:3306"
volumes:
- mysql_data:/var/lib/mysql
networks:
- django-network
healthcheck:
test: ['CMD-SHELL', 'mysqladmin ping -h 127.0.0.1 -u root --password=$$MYSQL_ROOT_PASSWORD']
interval: 5s
timeout: 2s
retries: 100
backend:
container_name: backend
build:
context: ./backend
dockerfile: Dockerfile
environment:
DJANGO_DEBUG: "True"
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
MYSQL_DATABASE: ${MYSQL_DATABASE}
MYSQL_USER: ${MYSQL_USER}
MYSQL_PASSWORD: ${MYSQL_PASSWORD}
ports:
- "8000:8000"
expose:
- 8000
depends_on:
db:
condition: service_healthy
volumes:
- ./backend:/backend
networks:
- django-network
healthcheck:
test:
[
"CMD-SHELL",
"curl --fail http://backend:8000/ || exit 1"
]
interval: 5s
timeout: 2s
retries: 10
cadvisor:
container_name: cadvisor
image: gcr.io/cadvisor/cadvisor:v0.47.1
ports:
- "8080:8080"
volumes:
- /:/rootfs:ro
- /var/run:/var/run:ro
- /sys:/sys:ro
- /var/lib/docker/:/var/lib/docker:ro
networks:
- django-network
depends_on:
- backend
# frontend:
# container_name: frontend
# build:
# context: ./frontend
# dockerfile: Dockerfile
# ports:
# - "5173:5173"
# volumes:
# # :을 기준으로 왼쪽은 빌드 이전의 로컬 폴더 오른쪽은 컨테이너 내부의 폴더
# - ./frontend:/app
# - /app/node_modules
# - build_folder:/app/dist # 빌드 디렉토리를 볼륨으로 마운트
volumes:
mysql_data:
build_folder:
name: build_folder
driver: local
networks:
django-network: