Repository navigation
refactor: 배포 환경 변수 수정 #56
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -32,6 +32,9 @@ jobs: | |
| - name: Gradle 명령 실행을 위한 권한을 부여합니다. | ||
| run: chmod +x gradlew | ||
|
|
||
| - name: application-secret.yml 파일 생성 | ||
| run: echo "${{ secrets.APPLICATION }}" > ./src/main/resources/application-secret.yml | ||
|
|
||
|
Comment on lines
+35
to
+37
|
||
| - name: Gradle clean build를 수행합니다. | ||
| run: ./gradlew clean build | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -8,50 +8,25 @@ services: | |||||||||
| ports: | ||||||||||
| - "8080:8080" | ||||||||||
| depends_on: | ||||||||||
| - db | ||||||||||
| - redis | ||||||||||
| redis: | ||||||||||
| condition: service_healthy | ||||||||||
| environment: | ||||||||||
| SPRING_PROFILES_ACTIVE: prod | ||||||||||
| SPRING_DATASOURCE_URL: ${SPRING_DATASOURCE_URL} | ||||||||||
| SPRING_DATASOURCE_USERNAME: ${SPRING_DATASOURCE_USERNAME} | ||||||||||
| SPRING_DATASOURCE_PASSWORD: ${SPRING_DATASOURCE_PASSWORD} | ||||||||||
| SPRING_REDIS_HOST: ${SPRING_REDIS_HOST} | ||||||||||
| SPRING_REDIS_PORT: ${SPRING_REDIS_PORT} | ||||||||||
| REDIS_HOST: ${SPRING_REDIS_HOST} | ||||||||||
| REDIS_PORT: ${SPRING_REDIS_PORT} | ||||||||||
|
Comment on lines
+18
to
+19
|
||||||||||
| REDIS_HOST: ${SPRING_REDIS_HOST} | |
| REDIS_PORT: ${SPRING_REDIS_PORT} | |
| REDIS_PROD_HOST: ${SPRING_REDIS_HOST} | |
| REDIS_PROD_PORT: ${SPRING_REDIS_PORT} |
Copilot
AI
Mar 26, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Redis 서비스는 기본적으로 컨테이너 내부에서 6379 포트로만 리슨하는데, 여기서는 expose: - ${SPRING_REDIS_PORT}로 포트를 변수화했습니다. SPRING_REDIS_PORT를 6379 이외 값으로 설정하면 앱은 그 포트로 접속을 시도하지만 Redis 컨테이너는 해당 포트에서 리슨하지 않아 연결이 실패합니다. 포트를 고정(6379)하거나, Redis 쪽도 동일 포트로 리슨하도록 command/설정으로 함께 변경해 주세요.
| container_name: retrip-redis | |
| container_name: retrip-redis | |
| command: ["redis-server", "--port", "${SPRING_REDIS_PORT}"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CI에서
secrets.APPLICATION내용을src/main/resources/application-secret.yml로 생성한 뒤 그대로 Gradle 빌드/도커 이미지 빌드에 포함됩니다. 이 파일에 DB/Redis/AWS 자격증명 같은 민감정보가 들어있다면, 결과 JAR/이미지(Docker Hub push 포함)에 영구적으로 내장되어 유출 위험이 큽니다. 런타임에서만 주입(예: 배포 시 EC2에서 파일 생성 후 볼륨 마운트, 또는 Spring 환경변수/Secrets Manager 사용)하도록 변경하는 것이 안전합니다.