Skip to content

Commit fc95ad1

Browse files
committed
refactor : 인프라 관련 구조 수정
1 parent fe91217 commit fc95ad1

2 files changed

Lines changed: 12 additions & 3 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,9 @@ jobs:
9797

9898
- name: Deploy to EC2
9999
run: |
100-
ssh -o StrictHostKeyChecking=no ${{ secrets.EC2_USER }}@${{ secrets.EC2_HOST }} "\
100+
mkdir -p ~/.ssh
101+
ssh-keyscan ${{ secrets.EC2_HOST }} >> ~/.ssh/known_hosts
102+
ssh ${{ secrets.EC2_USER }}@${{ secrets.EC2_HOST }} "\
101103
export WEBHOOK_SECRET='${{ secrets.WEBHOOK_SECRET }}' && \
102104
export GEMINI_API_KEY='${{ secrets.GEMINI_API_KEY }}' && \
103105
export API_TOKEN_GITHUB='${{ secrets.API_TOKEN_GITHUB }}' && \

Dockerfile

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
FROM eclipse-temurin:21-jdk
22

3+
# Create a non-root user and group
4+
RUN groupadd -r appgroup && useradd -r -g appgroup appuser
5+
6+
WORKDIR /app
7+
38
ARG JAR_FILE=build/libs/*.jar
4-
COPY ${JAR_FILE} app.jar
9+
COPY --chown=appuser:appgroup ${JAR_FILE} app.jar
10+
11+
USER appuser
512

6-
ENTRYPOINT ["java", "-jar", "/app.jar"]
13+
ENTRYPOINT ["java", "-jar", "app.jar"]

0 commit comments

Comments
 (0)