Skip to content

Commit

Permalink
CD 코드 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
SalkCoding committed Dec 12, 2024
1 parent 221b31a commit cae4460
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 22 deletions.
1 change: 0 additions & 1 deletion .github/workflows/CD.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,5 @@ jobs:
key: ${{ secrets.REMOTE_KEY }}
script: |
cd /home/***/Backend
git pull origin main
sudo docker compose down
sudo docker compose up -d
22 changes: 1 addition & 21 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,24 +26,4 @@ FROM openjdk:17-alpine
# 작업 디렉토리 설정
WORKDIR /app

# bash 설치 추가
RUN apk add --no-cache bash

# 루트 권한으로 변경
USER root

# wait-for-it 스크립트 복사 및 실행 권한 부여
COPY wait-for-it.sh /usr/local/bin/wait-for-it
RUN chmod +x /usr/local/bin/wait-for-it

# 빌드 이미지에서 생성된 JAR 파일을 런타임 이미지로 복사
COPY --from=build /app/build/libs/*.jar /app/ohlottery.jar

# 다시 기본 사용자로 변경
USER 1000

# 포트 노출
EXPOSE 8080

# MySQL과 Redis가 준비될 때까지 대기 후 백엔드 실행
ENTRYPOINT ["sh", "-c", "/usr/local/bin/wait-for-it mysql:3306 -- /usr/local/bin/wait-for-it redis:6379 -- java -jar /app/ohlottery.jar"]
ENTRYPOINT ["java","-jar","/app/ohlottery.jar"]

0 comments on commit cae4460

Please sign in to comment.