Skip to content

Commit 1ec813d

Browse files
author
nimuy99
committed
#29 Fix: deploy test 17
1 parent c779a09 commit 1ec813d

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

.github/workflows/deploy.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,17 @@ jobs:
1919
java-version: '17'
2020
cache: 'gradle'
2121

22-
- name: Create application.yml in build context
22+
- name: Create application.yml
2323
run: |
2424
mkdir -p src/main/resources
2525
echo "${{ secrets.APPLICATION_YML }}" > src/main/resources/application.yml
2626
shell: bash
2727

28+
- name: Ensure application.yml exists before Docker build
29+
run: |
30+
ls -l src/main/resources/application.yml || echo "application.yml not found!"
31+
cp src/main/resources/application.yml .
32+
2833
- name: Build with Gradle
2934
run: |
3035
chmod +x gradlew

Dockerfile

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,11 @@ FROM bellsoft/liberica-openjdk-alpine:17 AS builder
33

44
WORKDIR /app
55

6-
# Gradle 관련 파일 복사 및 빌드
76
COPY gradlew build.gradle settings.gradle /app/
87
COPY gradle /app/gradle
98
RUN chmod +x gradlew
109
RUN ./gradlew dependencies --no-daemon
1110

12-
# 프로젝트 전체 복사 및 빌드 실행
1311
COPY . .
1412
RUN ./gradlew clean build -x test --no-daemon
1513

@@ -21,10 +19,11 @@ WORKDIR /app
2119
# JAR 파일 복사
2220
COPY --from=builder /app/build/libs/*.jar app.jar
2321

24-
# GitHub Actions에서 생성한 `application.yml`을 컨테이너 내부로 복사
22+
# application.yml을 Docker 컨테이너 내부로 복사
2523
COPY src/main/resources/application.yml /app/config/application.yml
2624

2725
EXPOSE 8080
2826

29-
# Spring Boot가 설정 파일을 읽을 수 있도록 `SPRING_CONFIG_LOCATION` 지정
30-
ENTRYPOINT ["java", "-jar", "app.jar", "--spring.config.location=/app/config/application.yml"]
27+
# Spring Boot가 설정 파일을 읽도록 환경 변수 설정
28+
ENTRYPOINT ["java", "-jar", "app.jar"]
29+
CMD ["--spring.config.location=file:/app/config/application.yml"]

0 commit comments

Comments
 (0)