-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
executable file
·49 lines (47 loc) · 1.11 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
version: '3'
services:
mysql:
container_name: mysql-server
build:
context: ./
dockerfile: Dockerfile_mysql
volumes:
- ./mysql/:/var/lib/mysql
ports:
- "3306:3306"
networks:
- cats_database-network
django:
container_name: django-server
depends_on:
- mysql
healthcheck:
test: ["CMD", "curl", "-f", "0.0.0.0:3308"] # db 서비스의 상태를 확인하는 테스트
interval: 10s # 10초마다 테스트 수행
retries: 5 # 최대 5번 재시도
timeout: 5s
build:
context: ./
dockerfile: Dockerfile_django
volumes:
- ./django/cats_server:/home
command:
- bash
- -c
- |
cd /home/ &&
pip install -r requirements.txt &&
python3 manage.py makemigrations &&
python3 manage.py migrate &&
python3 manage.py makemigrations Api &&
python3 manage.py migrate &&
tail -f /dev/null
ports:
- "8000:8000"
expose:
- "8000"
networks:
- cats_database-network
networks:
cats_database-network:
driver: bridge