-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.https.yml
More file actions
65 lines (56 loc) · 1.45 KB
/
docker-compose.https.yml
File metadata and controls
65 lines (56 loc) · 1.45 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
version: '3.8'
services:
cms:
build:
context: .
dockerfile: Dockerfile
args:
DATABASE_URL: ${DATABASE_URL:-./sqlite.db}
container_name: cms
restart: unless-stopped
# HTTPS를 위해 내부 포트만 노출 (외부 포트는 Nginx가 처리)
expose:
- "3000"
environment:
- NODE_ENV=production
- PORT=3000
- HOST=0.0.0.0
- DATABASE_URL=/app/data/sqlite.db
# 프록시 뒤에서 실행 중임을 알림
- TRUST_PROXY=true
volumes:
- ./data:/app/data
- ./uploads:/app/uploads
networks:
- cms-network
healthcheck:
test: ["CMD", "wget", "--quiet", "--tries=1", "--spider", "http://localhost:3000"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
# Nginx 리버스 프록시 (HTTPS 처리)
nginx:
image: nginx:alpine
container_name: cms-nginx
restart: unless-stopped
ports:
- "80:80" # HTTP (리다이렉트용)
- "443:443" # HTTPS
volumes:
- ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro
- ./nginx/conf.d:/etc/nginx/conf.d:ro
- ./nginx/ssl:/etc/nginx/ssl:ro
- ./nginx/logs:/var/log/nginx
networks:
- cms-network
depends_on:
- cms
healthcheck:
test: ["CMD", "wget", "--quiet", "--tries=1", "--spider", "http://localhost/health"]
interval: 30s
timeout: 10s
retries: 3
networks:
cms-network:
driver: bridge