Skip to content

Commit

Permalink
update docker-compose.yml
Browse files Browse the repository at this point in the history
fix application.yml
  • Loading branch information
jjongwon7 committed Mar 13, 2023
1 parent a9eb974 commit 40d9c80
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 14 deletions.
2 changes: 2 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ bootJar {

dependencies {
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.springframework.boot:spring-boot-starter-thymeleaf'
implementation 'org.springframework.boot:spring-boot-starter-jdbc'
implementation 'org.springframework.boot:spring-boot-starter-data-redis'
//implementation 'org.springframework.boot:spring-boot-starter-security'
implementation 'org.springframework.boot:spring-boot-starter-web'
Expand Down
32 changes: 32 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
version: '3'
services:
mysqldb:
container_name: mysqldb
platform: linux/amd64
image: mysql:8.0.32
restart: always
environment:
- MYSQL_DATABASE=ST_DASHBOARD
- MYSQL_ROOT_PASSWORD=1234
- MYSQL_PASSWORD=1234
healthcheck:
test: [ 'CMD-SHELL', 'mysqladmin ping -h 127.0.0.1 -u root --password=$$MYSQL_ROOT_PASSWORD' ]
interval: 10s
timeout: 2s
retries: 100
ports:
- 3306:3306

backend:
build: .
restart: always
environment:
SPRING_DATASOURCE_DRIVER-CLASS-NAME: com.mysql.cj.jdbc.Driver
SPRING_DATASOURCE_URL: jdbc:mysql://mysqldb:3306/ST_DASHBOARD?allowPublicKeyRetrieval=true&useSSL=false&useUnicode=true&serverTimezone=Asia/Seoul
SPRING_DATASOURCE_USERNAME: root
SPRING_DATASOURCE_PASSWORD: 1234
ports:
- 8080:8080
depends_on:
mysqldb:
condition: service_healthy
14 changes: 0 additions & 14 deletions src/main/resources/application.properties

This file was deleted.

21 changes: 21 additions & 0 deletions src/main/resources/application.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
spring:
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://localhost:3306/test_db?allowPublicKeyRetrieval=true&useSSL=false&useUnicode=true&serverTimezone=Asia/Seoul
username: root
password: 1234
thymeleaf:
cache: false

# spring data jpa 설정
jpa:
database-platform: org.hibernate.dialect.MySQL5InnoDBDialect
open-in-view: false
show-sql: true
hibernate:
ddl-auto: create
generate-ddl: true

logging:
level:
sql: info

0 comments on commit 40d9c80

Please sign in to comment.