-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
69 lines (65 loc) · 1.54 KB
/
docker-compose.yml
File metadata and controls
69 lines (65 loc) · 1.54 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
services:
joo-coin-db:
image: mysql:latest
container_name: joo-coin-db
environment:
MYSQL_DATABASE: joo_coin_db
MYSQL_ROOT_PASSWORD: 1234
ports:
- "3306:3306"
volumes:
- db-data:/var/lib/mysql
- ./init.sql:/docker-entrypoint-initdb.d/init.sql
networks:
- joo-coin
healthcheck:
test:
["CMD", "mysqladmin", "ping", "-h", "localhost", "-u", "root", "-p1234"]
interval: 10s
timeout: 5s
retries: 5
joo-coin-backend:
build:
context: ./backend
dockerfile: Dockerfile
container_name: joo-coin-backend
env_file:
- ./backend/.env
ports:
- "8000:8000"
volumes:
- ./backend:/app
- /app/.venv # 가상환경은 컨테이너 내부 것 사용
depends_on:
joo-coin-db:
condition: service_healthy
networks:
- joo-coin
command: >
sh -c "
echo 'Waiting for database...' &&
sleep 5 &&
echo 'Running migrations...' &&
alembic upgrade head &&
echo 'Starting server...' &&
gunicorn -w 4 -k uvicorn.workers.UvicornWorker app.main:app --bind 0.0.0.0:8000 --timeout 120 --graceful-timeout 30
"
restart: unless-stopped
joo-coin-frontend:
build:
context: ./frontend
dockerfile: Dockerfile
container_name: joo-coin-frontend
ports:
- "5173:5173"
volumes:
- ./frontend:/app
- /app/node_modules
depends_on:
- joo-coin-backend
networks:
- joo-coin
volumes:
db-data:
networks:
joo-coin: