diff --git a/compose.yml b/compose.yml index 5e3a3e5..f1b675b 100644 --- a/compose.yml +++ b/compose.yml @@ -1,10 +1,11 @@ services: - postgres: - restart: on-failure - image: postgres:13 - ports: - - "5454:5432" + mysql: + image: 'mysql:latest' environment: - POSTGRES_USER: user - POSTGRES_PASSWORD: 123456 - POSTGRES_DB: sweater_db + - 'MYSQL_DATABASE=sweater_db' + - 'MYSQL_PASSWORD=123456' + - 'MYSQL_ROOT_PASSWORD=verysecret' + - 'MYSQL_USER=user' + ports: + - '3306' + diff --git a/pom.xml b/pom.xml index 1f37af7..4635ced 100644 --- a/pom.xml +++ b/pom.xml @@ -26,12 +26,10 @@ org.springframework.boot spring-boot-starter-mustache - org.springframework.boot spring-boot-starter-web - org.springframework.boot spring-boot-devtools @@ -43,7 +41,6 @@ spring-boot-starter-test test - org.springframework.boot spring-boot-starter-data-jpa @@ -55,8 +52,8 @@ true - org.postgresql - postgresql + com.mysql + mysql-connector-j runtime @@ -69,5 +66,4 @@ - diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index ca96bee..650d561 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -1,6 +1,6 @@ -spring.jpa.hibernate.ddl-auto = update -spring.datasource.url=jdbc:postgresql://localhost:5454/sweater_db +spring.jpa.hibernate.ddl-auto=update +spring.datasource.url=jdbc:mysql://${MYSQL_HOST:localhost}:3306/sweater_db spring.datasource.username=user spring.datasource.password=123456 -spring.datasource.driver-class-name=org.postgresql.Driver -spring.jpa.show-sql: true +spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver +