diff --git a/build.gradle.kts b/build.gradle.kts index 17853408..076a39eb 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -36,6 +36,9 @@ dependencies { implementation("com.google.firebase:firebase-admin:9.2.0") implementation("com.squareup.okhttp3:okhttp:4.2.2") + implementation("org.springframework.boot:spring-boot-starter-actuator") + implementation("io.micrometer:micrometer-registry-prometheus") + runtimeOnly("com.h2database:h2") runtimeOnly("com.mysql:mysql-connector-j") diff --git a/scripts/deploy-rolling.sh b/scripts/deploy-rolling.sh index 57a83dd4..15122c6d 100755 --- a/scripts/deploy-rolling.sh +++ b/scripts/deploy-rolling.sh @@ -97,6 +97,9 @@ cd "$COMPOSE_DIR" set_drain true +echo "기존 연결 종료 대기..." +sleep 15 + echo "[Pull] 새 이미지 받는 중..." docker compose pull diff --git a/src/main/resources/application-dev.yml b/src/main/resources/application-dev.yml index 142f81ad..27a440f6 100644 --- a/src/main/resources/application-dev.yml +++ b/src/main/resources/application-dev.yml @@ -20,3 +20,14 @@ server: session: cookie: same-site: none + +management: + endpoints: + web: + exposure: + include: "health,prometheus,loggers" + endpoint: + health: + show-details: never + prometheus: + enabled: true \ No newline at end of file diff --git a/src/main/resources/application-production.yml b/src/main/resources/application-production.yml index 8ae6c9bb..b381aefe 100644 --- a/src/main/resources/application-production.yml +++ b/src/main/resources/application-production.yml @@ -6,6 +6,11 @@ spring: jpa: hibernate: ddl-auto: validate + servlet: + session: + cookie: + same-site: none + security: jwt: token: @@ -13,14 +18,26 @@ security: access-expiry-days: ${ACCESS_TOKEN_EXPIRY_DAYS} refresh-secret-key: ${REFRESH_TOKEN_SECRET_KEY} refresh-expiry-days: ${REFRESH_TOKEN_EXPIRY_DAYS} + server: port: ${APPLICATION_PORT} forward-headers-strategy: native - servlet: - session: - cookie: - same-site: none springdoc: api-docs: enabled: false + +management: + endpoints: + web: + exposure: + include: "health,prometheus" + endpoint: + health: + show-details: never + prometheus: + enabled: true + metrics: + tags: + application: snackgame + environment: production \ No newline at end of file diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index 9ab0ffb6..94d0b037 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -26,5 +26,13 @@ springdoc: disabled: true override-with-generic-response: false +management: + endpoints: + web: + exposure: + include: "" + endpoint: + health: + show-details: never server: shutdown: graceful