From 52eb03606e2059bbc0e3e2f1fbd71add2f2a997e Mon Sep 17 00:00:00 2001 From: YoungJun Park Date: Sun, 10 Nov 2024 07:15:36 +0900 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Fix:=20Docker=20timezone?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 7 ++++++- src/main/kotlin/nexters/weski/batch/WeatherScheduler.kt | 4 ++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 242aef4..59bec87 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,10 @@ FROM openjdk:17-jdk-slim +# tzdata 패키지 설치 및 시간대 설정 +RUN apt-get update && apt-get install -y tzdata && \ + ln -sf /usr/share/zoneinfo/Asia/Seoul /etc/localtime && \ + echo "Asia/Seoul" > /etc/timezone + EXPOSE 8080 ARG JAR_FILE=build/libs/*.jar @@ -8,4 +13,4 @@ COPY ${JAR_FILE} weski-app.jar CMD java -Dserver.port=8080 \ -Dspring.datasource.username=master \ -Dspring.datasource.password=master \ - -jar /weski-app.jar + -jar /weski-app.jar \ No newline at end of file diff --git a/src/main/kotlin/nexters/weski/batch/WeatherScheduler.kt b/src/main/kotlin/nexters/weski/batch/WeatherScheduler.kt index 2a502cc..18b4103 100644 --- a/src/main/kotlin/nexters/weski/batch/WeatherScheduler.kt +++ b/src/main/kotlin/nexters/weski/batch/WeatherScheduler.kt @@ -12,12 +12,12 @@ class WeatherScheduler( externalWeatherService.updateCurrentWeather() } - @Scheduled(cron = "0 30 3 * * *") + @Scheduled(cron = "30 0 0 * * *") fun scheduledDailyWeatherUpdate() { externalWeatherService.updateDailyWeather() } - @Scheduled(cron = "0 10 5 * * *") + @Scheduled(cron = "0 1 0 * * *") fun scheduledHourlyAndDailyUpdate() { externalWeatherService.updateHourlyAndDailyWeather() }