-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
82 lines (78 loc) · 2.29 KB
/
docker-compose.yml
File metadata and controls
82 lines (78 loc) · 2.29 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
# ========================================
# GoodGame API - 로컬 개발 환경
# ========================================
# 사용법:
# 1. MySQL만 실행 (Spring은 IDE에서):
# docker compose up -d
# ./gradlew bootRun
#
# 2. 전체 실행 (MySQL + Spring):
# docker compose --profile full up -d
#
# 3. 종료:
# docker compose down
#
# 4. 데이터 초기화:
# docker compose down -v
# ========================================
services:
# ========================================
# MySQL Database (로컬 개발용)
# ========================================
mysql:
image: mysql:8.0
container_name: goodgame-mysql
restart: unless-stopped
ports:
- "3306:3306"
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: goodgame
MYSQL_USER: goodgame
MYSQL_PASSWORD: goodgame123
TZ: Asia/Seoul
volumes:
- mysql-data:/var/lib/mysql
command:
- --character-set-server=utf8mb4
- --collation-server=utf8mb4_unicode_ci
- --skip-character-set-client-handshake
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-u", "root", "-proot"]
interval: 10s
timeout: 5s
retries: 5
networks:
- goodgame-network
# ========================================
# Spring Boot Backend (로컬 전체 실행용)
# ========================================
backend:
build:
context: .
dockerfile: Dockerfile
container_name: goodgame-api
restart: unless-stopped
depends_on:
mysql:
condition: service_healthy
ports:
- "8080:8080"
environment:
SPRING_PROFILES_ACTIVE: local
SPRING_DATASOURCE_URL: jdbc:mysql://mysql:3306/goodgame?useSSL=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Seoul
SPRING_DATASOURCE_USERNAME: goodgame
SPRING_DATASOURCE_PASSWORD: goodgame123
JWT_SECRET: ${JWT_SECRET:-local-dev-secret-key-must-be-at-least-256-bits-long-for-hs256}
GOOGLE_CLIENT_ID: ${GOOGLE_CLIENT_ID:-}
GOOGLE_CLIENT_SECRET: ${GOOGLE_CLIENT_SECRET:-}
GOOGLE_REDIRECT_URI: ${GOOGLE_REDIRECT_URI:-http://localhost:8080/api/auth/google/callback}
networks:
- goodgame-network
profiles:
- full
volumes:
mysql-data:
networks:
goodgame-network:
driver: bridge