Skip to content

Commit

Permalink
Merge pull request #265 from Modagbul/main
Browse files Browse the repository at this point in the history
[release] deploy 프로필 설정 수정
  • Loading branch information
minsu20 authored Mar 4, 2024
2 parents c24e5ff + 173806e commit b952246
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .deploy/Dockerfile → .deploy/dev_dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ COPY ${JAR_FILE} app.jar
COPY ./build/docs/asciidoc/*.html /static/docs/

# 애플리케이션 실행 시 -cp 옵션을 사용하여 /static/docs 디렉토리를 클래스패스에 추가
ENTRYPOINT ["java","-cp",".:/static/docs","-jar","/app.jar"]
ENTRYPOINT ["java","-cp",".:/static/docs","-Dspring.profiles.active=dev","-jar","/app.jar"]

16 changes: 16 additions & 0 deletions .deploy/prod_dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
FROM openjdk:11-jdk

# 타임존 설정
ENV TZ=Asia/Seoul
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

ARG CACHEBREAKER=1
ARG JAR_FILE=./build/libs/backend-0.0.1-SNAPSHOT.jar
COPY ${JAR_FILE} app.jar

# 문서를 이미지의 /static/docs 디렉토리에 복사
COPY ./build/docs/asciidoc/*.html /static/docs/

# 애플리케이션 실행 시 -cp 옵션을 사용하여 /static/docs 디렉토리를 클래스패스에 추가
ENTRYPOINT ["java","-cp",".:/static/docs","-Dspring.profiles.active=prod","-jar","/app.jar"]

4 changes: 2 additions & 2 deletions .github/workflows/CD-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ jobs:
# Docker 이미지 빌드 및 푸시
- name: Docker build
run: |
docker build --no-cache -f ./.deploy/Dockerfile -t ${{ secrets.DOCKER_USERNAME_DEV }}/moing_dev:green .
docker build --no-cache -f ./.deploy/Dockerfile -t ${{ secrets.DOCKER_USERNAME_DEV }}/moing_dev:blue .
docker build --no-cache -f ./.deploy/dev_dockerfile -t ${{ secrets.DOCKER_USERNAME_DEV }}/moing_dev:green .
docker build --no-cache -f ./.deploy/dev_dockerfile -t ${{ secrets.DOCKER_USERNAME_DEV }}/moing_dev:blue .
- name: Docker Hub Login
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/CD-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ jobs:
# Docker 이미지 빌드 및 푸시
- name: Docker build
run: |
docker build --no-cache -f ./.deploy/Dockerfile -t ${{ secrets.DOCKER_USERNAME_PROD }}/moing_prod:green .
docker build --no-cache -f ./.deploy/Dockerfile -t ${{ secrets.DOCKER_USERNAME_PROD }}/moing_prod:blue .
docker build --no-cache -f ./.deploy/prod_dockerfile -t ${{ secrets.DOCKER_USERNAME_PROD }}/moing_prod:green .
docker build --no-cache -f ./.deploy/prod_dockerfile -t ${{ secrets.DOCKER_USERNAME_PROD }}/moing_prod:blue .
- name: Docker Hub Login
Expand Down

0 comments on commit b952246

Please sign in to comment.