Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Cicd/172] 서버 timezone KST로 설정 #173

Merged
merged 5 commits into from
Jan 18, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 14 additions & 15 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,42 +1,41 @@
# 빌드 이미지로 OpenJDK 17 & Gradle을 지정
# [1] 빌드 스테이지
FROM gradle:8.11.1-jdk17 AS build

# 소스코드를 복사할 작업 디렉토리를 생성
WORKDIR /app

# 빌드 시 전달받은 환경 변수 정의
# GitHub Actions에서 전달된 빌드 변수들을 ARG로 정의
# 빌드 시 전달받은 ARG(환경변수)
ARG JWT_SECRET

Check warning on line 7 in Dockerfile

View workflow job for this annotation

GitHub Actions / build-and-deploy

Sensitive data should not be used in the ARG or ENV commands

SecretsUsedInArgOrEnv: Do not use ARG or ENV instructions for sensitive data (ARG "JWT_SECRET") More info: https://docs.docker.com/go/dockerfile/rule/secrets-used-in-arg-or-env/
ARG RDS_PRIVATE_IP
ARG RDS_PORT
ARG DB_SCHEMA_NAME
ARG DB_USERNAME
ARG DB_PASSWORD

Check warning on line 12 in Dockerfile

View workflow job for this annotation

GitHub Actions / build-and-deploy

Sensitive data should not be used in the ARG or ENV commands

SecretsUsedInArgOrEnv: Do not use ARG or ENV instructions for sensitive data (ARG "DB_PASSWORD") More info: https://docs.docker.com/go/dockerfile/rule/secrets-used-in-arg-or-env/
ARG GMAIL_PWD
ARG RIOT_API
ARG SOCKET_SERVER_URL

# 라이브러리 설치에 필요한 파일만 복사
# Gradle 라이브러리 설치를 위한 초기 세팅
COPY build.gradle settings.gradle ./

RUN gradle dependencies --no-daemon

# 호스트 머신의 소스코드를 작업 디렉토리로 복사
# 소스코드 복사 후 빌드
COPY . /app

# Gradle 빌드를 실행하여 JAR 파일 생성
RUN gradle clean build --no-daemon

# 런타임 이미지로 OpenJDK 17-jre 이미지 지정
# [2] 런타임 스테이지
FROM eclipse-temurin:17-jre

# 애플리케이션을 실행할 작업 디렉토리를 생성
WORKDIR /app

# 빌드 이미지에서 생성된 JAR 파일을 런타임 이미지로 복사
# 1) 컨테이너 시간대 KST 설정
ENV TZ=Asia/Seoul
RUN apt-get update && apt-get install -y tzdata \
&& ln -snf /usr/share/zoneinfo/$TZ /etc/localtime \
&& echo $TZ > /etc/timezone \
&& apt-get clean && rm -rf /var/lib/apt/lists/*

# 2) 빌드 결과 JAR 복사
COPY --from=build /app/build/libs/*SNAPSHOT.jar /app/gamegoov2.jar

#EXPOSE 8080
# 3) 실행
CMD ["java", "-Dspring.profiles.active=dev", "-jar", "gamegoov2.jar"]


Loading