-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
59 lines (55 loc) · 1.71 KB
/
docker-compose.yml
File metadata and controls
59 lines (55 loc) · 1.71 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:
# 1. Nginx (웹 서버 & HTTPS 처리)
nginx:
image: nginx:1.25
container_name: nginx
ports:
- "80:80"
- "443:443"
volumes:
- ./nginx/conf.d:/etc/nginx/conf.d
- ./certbot/conf:/etc/letsencrypt
- ./certbot/www:/var/www/certbot
depends_on:
- blog-app
restart: always
# 2. Certbot (무료 SSL 인증서 발급기)
certbot:
image: certbot/certbot
container_name: certbot
volumes:
- ./certbot/conf:/etc/letsencrypt
- ./certbot/www:/var/www/certbot
# 3. Spring Boot 앱 (외부 노출 X, Nginx 뒤에 숨음)
blog-app:
container_name: blog-app
build: .
# ports 섹션 삭제됨 (Nginx가 8080으로 연결해줌)
environment:
- SPRING_PROFILES_ACTIVE=prod
- SPRING_DATASOURCE_URL=jdbc:mysql://blog-db:3306/blog_prod?useSSL=false&allowPublicKeyRetrieval=true&characterEncoding=UTF-8&serverTimezone=Asia/Seoul
- SPRING_DATASOURCE_USERNAME=root
- SPRING_DATASOURCE_PASSWORD=${DB_PASSWORD}
- CLOUD_AWS_CREDENTIALS_ACCESS_KEY=${AWS_ACCESS_KEY}
- CLOUD_AWS_CREDENTIALS_SECRET_KEY=${AWS_SECRET_KEY}
- BLOG_GIT_WEBHOOK_SECRET=${WEBHOOK_SECRET}
- BLOG_SITE_URL=${BLOG_SITE_URL:-https://devkobe-blog.com}
- SPRING_JPA_HIBERNATE_DDL_AUTO=update
depends_on:
- blog-db
restart: always
# 4. MySQL DB (기존과 동일)
blog-db:
container_name: blog-db
image: mysql:8.0
environment:
MYSQL_DATABASE: blog_prod
MYSQL_ROOT_PASSWORD: ${DB_PASSWORD}
TZ: Asia/Seoul
volumes:
- ./db_data:/var/lib/mysql
command:
- --character-set-server=utf8mb4
- --collation-server=utf8mb4_unicode_ci
restart: always