-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
58 lines (52 loc) · 1.55 KB
/
docker-compose.yml
File metadata and controls
58 lines (52 loc) · 1.55 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
version: '3.8'
services:
# Next.js 애플리케이션
nextjs:
container_name: global-nomad-nextjs
# 환경 변수로 이미지 지정 (기본값 제공)
image: ${NEXTJS_IMAGE:-ghcr.io/cksgh5477/global-nomad:latest}
# 로컬 개발용 빌드 설정 (프로덕션에서는 무시됨)
build:
context: .
dockerfile: Dockerfile
restart: unless-stopped
env_file:
- .env
environment:
- NODE_ENV=production
networks:
- app-network
# 외부 포트 노출하지 않고, Nginx를 통해서만 접근
# Nginx 리버스 프록시
nginx:
container_name: global-nomad-nginx
image: nginx:alpine
restart: unless-stopped
ports:
- '80:80'
- '443:443'
volumes:
# Nginx 설정 파일
- ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro
- ./nginx/conf.d:/etc/nginx/conf.d:ro
# SSL 인증서 저장 위치
- ./certbot/conf:/etc/letsencrypt:ro
- ./certbot/www:/var/www/certbot:ro
depends_on:
- nextjs
networks:
- app-network
command: '/bin/sh -c ''while :; do sleep 6h & wait $${!}; nginx -s reload; done & nginx -g "daemon off;"'''
# Let's Encrypt 인증서 자동 갱신
certbot:
container_name: global-nomad-certbot
image: certbot/certbot
restart: unless-stopped
volumes:
- ./certbot/conf:/etc/letsencrypt
- ./certbot/www:/var/www/certbot
entrypoint: "/bin/sh -c 'trap exit TERM; while :; do certbot renew; sleep 12h & wait $${!}; done;'"
# 네트워크 설정
networks:
app-network:
driver: bridge