diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..4e8b4df --- /dev/null +++ b/Dockerfile @@ -0,0 +1,11 @@ +FROM openjdk:21-jdk-slim + +WORKDIR /app + +COPY build/libs/*.jar app.jar + +ENV SPRING_PROFILES_ACTIVE=prod + +EXPOSE 8080 + +ENTRYPOINT ["java", "-jar", "app.jar"] diff --git a/build.gradle b/build.gradle index 3c88f9e..7596bba 100644 --- a/build.gradle +++ b/build.gradle @@ -30,7 +30,7 @@ dependencies { implementation 'org.springframework.boot:spring-boot-starter-webflux' implementation "org.springdoc:springdoc-openapi-starter-webmvc-api:2.8.5" implementation "org.springdoc:springdoc-openapi-starter-webmvc-ui:2.8.5" - + implementation 'mysql:mysql-connector-java:8.0.33' compileOnly 'org.projectlombok:lombok' runtimeOnly 'com.h2database:h2' diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index cb6bbcd..a7d14fc 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -1,13 +1,15 @@ spring: application: name: crew -#JPA + #JPA datasource: - driver-class-name: org.h2.Driver - url: jdbc:h2:mem:test;DB_CLOSE_DELAY=-1;DATABASE_TO_UPPER=false;MODE=MySQL + driver-class-name: com.mysql.cj.jdbc.Driver + url: jdbc:mysql://retripstudydb.cv4sss0i0mk8.ap-southeast-2.rds.amazonaws.com:3306/crew?serverTimezone=Asia/Seoul&characterEncoding=UTF-8 + username: ${DB_USERNAME} + password: ${DB_PASSWORD} jpa: hibernate: - ddl-auto: create-drop + ddl-auto: update properties: hibernate: show_sql: true