From 1b3b5abf2f1e7d30cd4988c1411bbf10d0655ff8 Mon Sep 17 00:00:00 2001 From: wjdtkdgns Date: Tue, 21 Nov 2023 09:25:17 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20deploy=20branch=20prod=EB=A1=9C=20?= =?UTF-8?q?=EB=B3=80=EA=B2=BD=20#3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/Deploy.yml | 2 +- Dockerfile | 2 +- .../resources/config/application-prod.yml | 47 +++++++++++++++++++ 3 files changed, 49 insertions(+), 2 deletions(-) create mode 100644 src/main/resources/config/application-prod.yml diff --git a/.github/workflows/Deploy.yml b/.github/workflows/Deploy.yml index 1f71bb87..7038f0c3 100644 --- a/.github/workflows/Deploy.yml +++ b/.github/workflows/Deploy.yml @@ -2,7 +2,7 @@ name: Deploy on: push: - branches: ['develop'] + branches: ['main'] env: ACTIVE_PROFILE: "prod" diff --git a/Dockerfile b/Dockerfile index e1ef217e..dcbae74c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,7 +3,7 @@ FROM amazoncorretto:17 ARG JAR_FILE=./build/libs/*.jar COPY ${JAR_FILE} app.jar -ARG PROFILE=dev +ARG PROFILE=prod ENV PROFILE=${PROFILE} ENTRYPOINT ["java","-Dspring.profiles.active=${PROFILE}", "-Djava.security.egd=file:/dev/./urandom","-jar","/app.jar"] diff --git a/src/main/resources/config/application-prod.yml b/src/main/resources/config/application-prod.yml new file mode 100644 index 00000000..c47cb78f --- /dev/null +++ b/src/main/resources/config/application-prod.yml @@ -0,0 +1,47 @@ +# =================================================================== +# Spring Boot Configuration for the prod profile +# =================================================================== + +# SERVER +server: + error: + include-exception: true # Include the "exception" attribute. + include-stacktrace: always # When to include a "stacktrace" attribute. + whitelabel.enabled: true + +# LOGGING +logging: + level: + root: INFO + com.oksusu: DEBUG + org.hibernate.SQL: DEBUG + org.hibernate.type.descriptor.sql.BasicBinder: TRACE + org.springframework.jdbc.core.JdbcTemplate: DEBUG + org.springframework.jdbc.core.StatementCreatorUtils: TRACE + org.springframework.orm.jpa.JpaTransactionManager: DEBUG + org.springframework.web.server.adapter.HttpWebHandlerAdapter: DEBUG + reactor.netty.http.client: DEBUG + +# SPRING +spring: + jackson: + serialization: + indent_output: true + +# DEV-DATABASE-COMMON +datasource: &prod-datasource + url: jdbc:mysql://${MYSQL_HOST}:${MYSQL_PORT}/${DB_NAME}?useUnicode=true&charset=utf8mb4&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull + username: ${MYSQL_USERNAME} + password: ${MYSQL_PASSWORD} + hikari: + minimum-idle: 2 + maximum-pool-size: 2 + +# DATABASE +susu: + master.datasource: *prod-datasource + jpa: + properties: + hibernate.format_sql: true + hibernate.hbm2ddl.auto: none + maximum-jdbc-thread-pool-size: