-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
48 lines (46 loc) · 1.49 KB
/
Copy pathdocker-compose.yml
File metadata and controls
48 lines (46 loc) · 1.49 KB
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
services:
db:
image: mysql:8.4
restart: unless-stopped
command: --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
environment:
MYSQL_DATABASE: ${MYSQL_DATABASE}
MYSQL_USER: ${MYSQL_USER}
MYSQL_PASSWORD: ${MYSQL_PASSWORD}
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
ports:
- "3306:3306"
volumes:
- mysql_data:/var/lib/mysql
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-u", "root", "-p$$MYSQL_ROOT_PASSWORD"]
interval: 5s
timeout: 5s
retries: 10
backend:
build: ./backend
restart: unless-stopped
command: python manage.py runserver 0.0.0.0:8000
# .env에 새 변수(KAKAO_* 등)를 추가하면 여기 따로 안 적어도 자동으로 들어온다.
env_file:
- .env
environment:
DB_NAME: ${MYSQL_DATABASE}
DB_USER: ${MYSQL_USER}
DB_PASSWORD: ${MYSQL_PASSWORD}
DB_HOST: db
DB_PORT: 3306
ports:
# 호스트 8000번을 다른 프로세스가 쓰고 있어 8001로 바꿈. 컨테이너 안쪽은 여전히
# 8000이라 Django 설정은 그대로고, 프론트에서만 DJANGO_ORIGIN=http://127.0.0.1:8001
# 로 맞춰주면 된다 (frontend/AGENTS.md 참고).
- "8001:8000"
volumes:
- ./backend:/app
# 호스트에서 만든 .venv(macOS용)가 컨테이너를 덮어쓰지 않도록 분리
- /app/.venv
depends_on:
db:
condition: service_healthy
volumes:
mysql_data: