diff --git a/Dockerfile b/Dockerfile index 58ab330..3e77954 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,5 @@ FROM openjdk:17-jdk-slim WORKDIR /app COPY target/lab-crud-0.0.1-SNAPSHOT.jar lab-crud.jar +EXPOSE 8080 CMD ["java", "-jar", "lab-crud.jar"] diff --git a/pom.xml b/pom.xml index 82ccc0c..785cdd6 100644 --- a/pom.xml +++ b/pom.xml @@ -44,15 +44,16 @@ lombok true - - com.mysql - mysql-connector-j - org.springframework.boot spring-boot-starter-test test + + com.h2database + h2 + runtime + diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index ca2fd5f..dc245af 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -1,9 +1,8 @@ spring.application.name=lab-crud -spring.datasource.url=jdbc:mysql://${DB_HOST:localhost}:3306/${DB_NAME:labcrud} -spring.datasource.username=${DB_USER:root} +spring.datasource.url=jdbc:h2:mem:${DB_NAME:labcrud} +spring.datasource.username=${DB_USER:sa} spring.datasource.password=${DB_PASSWORD:password} -spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver +spring.datasource.driver-class-name=org.h2.Driver spring.jpa.hibernate.ddl-auto=update spring.jpa.show-sql=true -spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL8Dialect spring.config.import=optional:file:.env \ No newline at end of file