-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
76 lines (72 loc) · 1.79 KB
/
docker-compose.yml
File metadata and controls
76 lines (72 loc) · 1.79 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
70
71
72
73
74
75
76
services:
app: # 서비스명
build: .
container_name: myapp # 컨테이너명
command: >
sh -c "pnpm start"
env_file: # .env 가져오기
- .env
environment:
- NODE_ENV=production
expose:
- "3000" # 내부 네트워크만 노출 (Caddy가 프록시)
healthcheck:
test: ["CMD", "curl", "-f", "http://127.0.0.1:3000/health"] # 컨테이너 내부 IP로 헬스체크 확인
interval: 30s
timeout: 3s
start_period: 20s
retries: 5
restart: unless-stopped
networks:
- webnet
logging:
driver: json-file
options:
max-size: "10m"
max-file: "3"
app-dev: # 서비스명
build: .
container_name: myapp-dev # 컨테이너명
command: >
sh -c "pnpm start"
env_file: # .env 가져오기
- .env.dev
environment:
- NODE_ENV=development
expose:
- "3000" # 내부 네트워크만 노출 (Caddy가 프록시)
healthcheck:
test: ["CMD", "curl", "-f", "http://127.0.0.1:3000/health"] # 컨테이너 내부 IP로 헬스체크 확인
interval: 30s
timeout: 3s
start_period: 20s
retries: 5
restart: unless-stopped
networks:
- webnet
logging:
driver: json-file
options:
max-size: "10m"
max-file: "3"
caddy: # caddy 컨테이너
image: caddy:2.8.4
container_name: caddy
ports:
- "80:80"
- "443:443"
volumes:
- ./Caddyfile:/etc/caddy/Caddyfile:ro
- caddy_data:/data
- caddy_config:/config
depends_on:
app:
condition: service_healthy # app이 healthy일 때만 시작
restart: unless-stopped
networks:
- webnet
networks:
webnet:
volumes:
caddy_data:
caddy_config: