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

[release] deploy 프로필 설정 수정 #265

Merged
merged 3 commits into from
Mar 4, 2024
Merged
Show file tree
Hide file tree
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
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
Loading