-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
127 lines (117 loc) ยท 3.41 KB
/
docker-compose.yml
File metadata and controls
127 lines (117 loc) ยท 3.41 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
version: '3.8'
services:
# Spring Boot ์ ํ๋ฆฌ์ผ์ด์
app:
# ๋ก์ปฌ ๊ฐ๋ฐ: build ์ฌ์ฉ, ์ด์ ๋ฐฐํฌ: image ์ฌ์ฉ
image: ${DOCKERHUB_USERNAME:-local}/buildup:${IMAGE_TAG:-latest}
build:
context: .
dockerfile: Dockerfile
container_name: buildup-app
restart: unless-stopped
ports:
- "${APP_PORT:-8080}:8080"
env_file:
- .env
environment:
# Spring ์ค์
SPRING_PROFILES_ACTIVE: ${SPRING_PROFILES_ACTIVE:-prod}
# ๋ฐ์ดํฐ๋ฒ ์ด์ค ์ค์
SPRING_DATASOURCE_URL: jdbc:mysql://mysql:3306/${MYSQL_DATABASE}?serverTimezone=Asia/Seoul&characterEncoding=UTF-8&useSSL=false
SPRING_DATASOURCE_USERNAME: ${MYSQL_USER}
SPRING_DATASOURCE_PASSWORD: ${MYSQL_PASSWORD}
# JWT ๋ฐ ์ํธํ
JWT_SECRET: ${JWT_SECRET}
ENCRYPTION_KEY: ${ENCRYPTION_KEY}
# ๊ด๋ฆฌ์ ๊ณ์
ADMIN_USERNAME: ${ADMIN_USERNAME:-admin}
ADMIN_PASSWORD: ${ADMIN_PASSWORD}
# AWS S3 ์ค์
AWS_S3_ENABLED: ${AWS_S3_ENABLED:-true}
AWS_S3_BUCKET: ${AWS_S3_BUCKET}
AWS_REGION: ${AWS_REGION:-ap-northeast-2}
AWS_ACCESS_KEY_ID: ${AWS_ACCESS_KEY_ID}
AWS_SECRET_ACCESS_KEY: ${AWS_SECRET_ACCESS_KEY}
# AI Face API ์ค์ (์ ํ์ฌํญ)
AI_FACE_SIMILARITY_BASE_URL: ${AI_FACE_SIMILARITY_BASE_URL:-http://localhost:8000}
AI_FACE_SIMILARITY_API_KEY: ${AI_FACE_SIMILARITY_API_KEY}
volumes:
- app_logs:/var/log/buildup
depends_on:
mysql:
condition: service_healthy
networks:
- buildup-network
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080/api/actuator/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 60s
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
# MySQL ๋ฐ์ดํฐ๋ฒ ์ด์ค
mysql:
image: mysql:8.0
container_name: buildup-mysql-prod
restart: unless-stopped
ports:
- "${MYSQL_PORT:-3306}:3306"
environment:
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
MYSQL_DATABASE: ${MYSQL_DATABASE}
MYSQL_USER: ${MYSQL_USER}
MYSQL_PASSWORD: ${MYSQL_PASSWORD}
TZ: Asia/Seoul
volumes:
- mysql_data_prod:/var/lib/mysql
- ./docker/mysql/init:/docker-entrypoint-initdb.d
command:
- --character-set-server=utf8mb4
- --collation-server=utf8mb4_unicode_ci
- --default-authentication-plugin=mysql_native_password
- --max_connections=200
- --max_allowed_packet=67108864 # 64MB
networks:
- buildup-network
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-u", "${MYSQL_USER}", "-p${MYSQL_PASSWORD}"]
interval: 10s
timeout: 5s
retries: 5
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
# Nginx (๋ฆฌ๋ฒ์ค ํ๋ก์)
nginx:
image: nginx:alpine
container_name: buildup-nginx
restart: unless-stopped
ports:
- "80:80"
- "443:443"
volumes:
- ./docker/nginx/nginx.conf:/etc/nginx/nginx.conf:ro
- ./docker/nginx/ssl:/etc/nginx/ssl:ro
depends_on:
- app
networks:
- buildup-network
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
volumes:
mysql_data_prod:
driver: local
app_logs:
driver: local
networks:
buildup-network:
driver: bridge