Skip to content

Commit 78a2c68

Browse files
committed
feat: 로컬 및 테스트 환경을 위한 DB 연동 설정
1 parent f9430a9 commit 78a2c68

File tree

4 files changed

+23
-0
lines changed

4 files changed

+23
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
data.sql
12
application.properties
23
HELP.md
34
.gradle

build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ dependencies {
3434
runtimeOnly("com.h2database:h2")
3535
runtimeOnly("com.mysql:mysql-connector-j")
3636
annotationProcessor("org.springframework.boot:spring-boot-configuration-processor")
37+
developmentOnly("org.springframework.boot:spring-boot-docker-compose")
3738
testImplementation("org.springframework.boot:spring-boot-starter-test")
3839
testImplementation("io.kotest:kotest-runner-junit5:5.8.0")
3940
testImplementation("com.appmattus.fixture:fixture:1.2.0")

compose.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
services:
2+
mysql:
3+
image: 'mysql:latest'
4+
environment:
5+
- 'MYSQL_DATABASE=gcm'
6+
- 'MYSQL_ROOT_PASSWORD=verysecret'
7+
- 'MYSQL_USER=nilgil'
8+
- 'MYSQL_PASSWORD=secret'
9+
ports:
10+
- '3306:3306'

src/main/resources/application.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,13 @@
11
spring:
22
application.name: generic-commerce
3+
jpa:
4+
open-in-view: false
5+
hibernate:
6+
ddl-auto: create
7+
show-sql: true
8+
defer-datasource-initialization: true
9+
properties:
10+
hibernate:
11+
format_sql: true
12+
sql.init.mode: always
13+
docker.compose.lifecycle-management: start_only

0 commit comments

Comments
 (0)