Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ dependencies {
runtimeOnly 'io.jsonwebtoken:jjwt-jackson:0.11.5'
compileOnly 'org.projectlombok:lombok'
developmentOnly 'org.springframework.boot:spring-boot-devtools'
runtimeOnly 'org.mariadb.jdbc:mariadb-java-client:3.3.3'
// runtimeOnly 'org.mariadb.jdbc:mariadb-java-client:3.3.3'
runtimeOnly 'mysql:mysql-connector-java:8.0.33'
annotationProcessor 'org.projectlombok:lombok'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testImplementation 'org.springframework.restdocs:spring-restdocs-mockmvc'
Expand Down
16 changes: 8 additions & 8 deletions compose.yaml
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
services:
mariadb:
image: 'mariadb:latest'
mysql:
image: 'mysql:8.0'
environment:
- 'MYSQL_DATABASE=hi_meow'
- 'MYSQL_USER=admin'
- 'MYSQL_PASSWORD=1234'
- 'MARIADB_ROOT_PASSWORD=1234'
- 'MYSQL_ROOT_PASSWORD=1234'
ports:
- '3306:3306'
volumes:
- mariadb_data:/var/lib/mysql
- mysql_data:/var/lib/mysql
healthcheck:
test: mariadb --user=root --password=1234 -e 'SELECT 1;'
test: mysql --user=root --password=1234 -e 'SELECT 1;'
interval: 1s
timeout: 1s
retries: 5
Expand All @@ -25,14 +25,14 @@ services:
- '8080:8080'
environment:
- 'SPRING_PROFILES_ACTIVE=local'
- 'SPRING_DATASOURCE_URL=jdbc:mariadb://mariadb:3306/hi_meow'
- 'SPRING_DATASOURCE_URL=jdbc:mysql://mysql:3306/hi_meow'
- 'SPRING_DATASOURCE_USERNAME=admin'
- 'SPRING_DATASOURCE_PASSWORD=1234'
- 'LOGGING_LEVEL_ROOT=INFO'
- 'LOGGING_LEVEL_COM_EXAMPLE=DEBUG'
depends_on:
mariadb:
mysql:
condition: service_healthy

volumes:
mariadb_data:
mysql_data:
6 changes: 3 additions & 3 deletions src/main/resources/application-local.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
spring:
datasource:
url: jdbc:mariadb://localhost:3306/hi_meow
url: jdbc:mysql://mysql_spring:3306/hi_meow
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

localhost는 수정하면 안되는거아녀?

username: admin
password: 1234
driver-class-name: org.mariadb.jdbc.Driver
driver-class-name: com.mysql.cj.jdbc.Driver
jpa:
hibernate:
ddl-auto: update
show-sql: true
properties:
hibernate:
format_sql: true
dialect: org.hibernate.dialect.MariaDBDialect
dialect: org.hibernate.dialect.MySQLDialect
mvc:
cors:
allowed-origins: http://localhost:80,http://localhost:3000
Expand Down