Skip to content

Commit

Permalink
Merge pull request #98 from Ong-gi-Jong-gi/feature/TSK-53/exception
Browse files Browse the repository at this point in the history
🚨firebase CI/CD🚨
  • Loading branch information
minjoon-98 authored Jul 21, 2024
2 parents cec5cfc + f734a3b commit 49d34c2
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/src/main/java/ongjong/namanmoo/config/PropertyConfig.java
/src/main/java/ongjong/namanmoo/config/ServiceProperties.java
/src/main/resources/env.properties
/src/main/resources/mooluck-fcm-firebase-adminsdk.json
#/src/main/resources/mooluck-fcm-firebase-adminsdk.json
/.env
6 changes: 3 additions & 3 deletions .github/workflows/Spring Boot CI-CD.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:

# firebase.json file 생성
- name: Create firebase.json file
run: echo '${{ secrets.FIREBASE_ADMINSDK_JSON }}' > mooluck-fcm-firebase-adminsdk.json
run: echo '${{ secrets.FIREBASE_ADMINSDK_JSON }}' > /tmp/firebase-config.json

# 이미지 이름을 날짜와 함께 설정
- name: Set image name with date
Expand All @@ -62,7 +62,7 @@ jobs:
# Docker 이미지 빌드 및 푸시
- name: Build and push Docker image
run: |
docker build . -t ${{ env.IMAGE_NAME }} --build-arg FIREBASE_JSON_FILENAME=mooluck-fcm-firebase-adminsdk.json
docker build . -t ${{ env.IMAGE_NAME }} --build-arg FIREBASE_CONFIG_FILE=/tmp/firebase-config.json
docker push ${{ env.IMAGE_NAME }}
# docker build . --file Dockerfile -t ${{ env.IMAGE_NAME }}

Expand Down Expand Up @@ -129,7 +129,7 @@ jobs:
-e OPENAI_API_KEY="${{ secrets.OPENAI_API_KEY }}" \
-e FFMPEG_PATH="${{ secrets.FFMPEG_PATH }}" \
-e FFPROBE_PATH="${{ secrets.FFPROBE_PATH }}" \
-e FIREBASE_CONFIG_PATH="/app/mooluck-fcm-firebase-adminsdk.json" \
-e FIREBASE_CONFIG_PATH="/app/firebase-config.json" \
${{ env.IMAGE_NAME }}
sudo docker ps -a
sudo docker system prune -f
Expand Down
9 changes: 4 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
# jdk17 Image Start
FROM openjdk:17-slim

# Firebase Secret 파일 인자 추가
ARG FIREBASE_JSON_FILENAME=mooluck-fcm-firebase-adminsdk.json
COPY $FIREBASE_JSON_FILENAME /app/$FIREBASE_JSON_FILENAME

# 인자 설정 - JAR_FILE
ARG JAR_FILE=build/libs/*.jar

# jar File Copy
COPY ${JAR_FILE} mooluck-spring.jar

# Firebase Config Copy
COPY ${FIREBASE_CONFIG_FILE} /app/firebase-config.json

# 필요한 패키지 설치
RUN apt-get update && apt-get install -y ffmpeg

Expand All @@ -19,4 +18,4 @@ ENV FFMPEG_PATH=/usr/bin/ffmpeg
ENV FFPROBE_PATH=/usr/bin/ffprobe

# 기본 프로파일 실행 명령어
ENTRYPOINT ["java", "-Dfirebase.config.path=/app/mooluck-fcm-firebase-adminsdk.json", "-jar", "mooluck-spring.jar", "-Dspring.profiles.active=docker", "-Duser.timezone=Asia/Seoul"]
ENTRYPOINT ["java", "-Dfirebase.config.path=/app/firebase-config.json", "-jar", "mooluck-spring.jar", "-Dspring.profiles.active=docker", "-Duser.timezone=Asia/Seoul"]

0 comments on commit 49d34c2

Please sign in to comment.