Skip to content

도커 컴포즈 환경변수 포맷 및 설정 가이드 정리#201

Merged
zionhann merged 2 commits intoHandongSF:mainfrom
zionhann:fix/compose-config-location-format
Mar 6, 2026
Merged

도커 컴포즈 환경변수 포맷 및 설정 가이드 정리#201
zionhann merged 2 commits intoHandongSF:mainfrom
zionhann:fix/compose-config-location-format

Conversation

@zionhann
Copy link
Member

@zionhann zionhann commented Mar 5, 2026

  • Docker Compose 환경 변수 정의를 key-value 형식으로 정리

    Compose의 환경 변수 목록을 맵 형식으로 바꿔 값 전달 방식을 더 명확하게 맞췄습니다. 이 변경은 리뷰에서 지적된 가독성 문제를 줄이고, 문자열 값에 불필요한 따옴표가 섞여 들어갈 여지를 줄이는 목적이 있습니다. 특히 SPRING_PROFILES_ACTIVESPRING_CONFIG_ADDITIONAL_LOCATION처럼 부팅 동작에 직접 영향을 주는 변수는 선언 형태가 단순할수록 운영 중 해석 오류를 줄이기 쉽습니다. 결과적으로 설정 파일 경로가 기대한 형태로 전달되는 구성을 더 분명하게 유지할 수 있습니다.

  • 외부 Spring 설정 파일 준비 절차를 README에 추가

    현재 Compose 설정은 /config/application-<profile>.yml 파일이 호스트에 준비되어 있다는 전제를 갖고 동작합니다. 그래서 README에 CONFIG_PATH, ACTIVE_PROFILE, 파일명 규칙, 권한 점검, 마운트와 실행 예시를 단계별로 정리했습니다. 이 문서는 새 환경에서 배포를 재현할 때 필요한 사전 준비를 빠뜨리지 않도록 돕는 데 목적이 있습니다. 운영자나 협업자가 설정 파일 위치와 프로필별 파일명을 추측하지 않고 바로 따라갈 수 있게 했습니다.

@coderabbitai
Copy link

coderabbitai bot commented Mar 5, 2026

📝 Walkthrough

Walkthrough

환경 변수 처리 방식을 변경하였습니다. SPRING_PROFILES_ACTIVE의 따옴표를 제거하고, SPRING_CONFIG_ADDITIONAL_LOCATION의 기본값을 application-${ACTIVE_PROFILE:-dev}.yml로 수정하였습니다. 또한 파일 경로의 따옴표를 제거하여 파싱 및 공백 처리 방식에 영향을 미칩니다.

Changes

Cohort / File(s) Summary
Docker Compose 구성
docker-compose.yml
환경 변수에서 따옴표 제거: SPRING_PROFILES_ACTIVE는 ${ACTIVE_PROFILE:-dev}로 변경, SPRING_CONFIG_ADDITIONAL_LOCATION은 file:/config/application-${ACTIVE_PROFILE:-dev}.yml로 변경되어 ACTIVE_PROFILE 미설정 시 기본값이 application-.yml에서 application-dev.yml로 변경됨
🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive 제목은 Docker Compose 환경변수 포맷 정리를 언급하지만, 실제 변경사항인 따옴표 제거 및 기본값 설정 변경의 구체적인 목적을 충분히 반영하지 않습니다. 제목을 더 구체적으로 수정하여 따옴표 제거 및 기본 프로필 설정 변경의 핵심 내용을 명확히 전달하도록 개선하기를 권장합니다.
✅ Passed checks (2 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description check ✅ Passed 설명은 환경변수 포맷 변경과 README 추가 항목을 다루고 있으며, raw_summary의 변경사항과 관련성이 있습니다.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@zionhann zionhann changed the title Compose Spring 설정 경로 환경변수 포맷 오류 수정 도커 컴포즈 환경변수 포맷 오류 수정 Mar 5, 2026
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
docker-compose.yml (1)

9-9: 배포 문서에 /config/application-<profile>.yml 준비 절차를 추가해 주세요.

Line 9는 외부 마운트 파일(/config/application-${ACTIVE_PROFILE:-dev}.yml)을 전제로 동작하므로, README에 CONFIG_PATH, ACTIVE_PROFILE, 파일명 규칙 예시를 명시해 두는 것이 좋겠습니다. 운영/온보딩 실패를 줄일 수 있습니다.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docker-compose.yml` at line 9, README에 외부 마운트된 Spring 설정 파일에 대한 준비 절차를 추가하세요:
문서에 SPRING_CONFIG_ADDITIONAL_LOCATION 환경 변수와 사용되는 경로
`/config/application-${ACTIVE_PROFILE:-dev}.yml`을 설명하고, CONFIG_PATH(예: /config),
ACTIVE_PROFILE(예: dev, staging, prod) 설정 방법, 파일명 규칙 예시(예: application-dev.yml,
application-prod.yml) 및 파일 권한/소유자와 마운트 방법을 단계별로 기재해 온보딩 시 누락되지 않도록 하세요.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@docker-compose.yml`:
- Line 9: README에 외부 마운트된 Spring 설정 파일에 대한 준비 절차를 추가하세요: 문서에
SPRING_CONFIG_ADDITIONAL_LOCATION 환경 변수와 사용되는 경로
`/config/application-${ACTIVE_PROFILE:-dev}.yml`을 설명하고, CONFIG_PATH(예: /config),
ACTIVE_PROFILE(예: dev, staging, prod) 설정 방법, 파일명 규칙 예시(예: application-dev.yml,
application-prod.yml) 및 파일 권한/소유자와 마운트 방법을 단계별로 기재해 온보딩 시 누락되지 않도록 하세요.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: b7f8369e-b4aa-40e5-b14c-0d2ae2ce1d76

📥 Commits

Reviewing files that changed from the base of the PR and between 41c94a7 and 56e2db3.

📒 Files selected for processing (1)
  • docker-compose.yml

@gemini-code-assist
Copy link

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

이 Pull Request는 Docker Compose 환경에서 Spring 애플리케이션의 설정 파일 로딩 문제를 해결합니다. 환경 변수 값에 포함된 불필요한 따옴표를 제거하여 설정 경로 파싱 오류를 수정하고, 추가 설정 파일 경로의 프로필 치환에 기본값을 명시하여 프로필 계산의 일관성을 확보합니다. 이를 통해 애플리케이션 시작 시 설정 파일 로딩 실패 가능성을 줄이고 운영 예측 가능성을 높입니다.

Highlights

  • Docker Compose 환경변수 따옴표 제거: Spring 환경변수 값에서 불필요한 따옴표를 제거하여 설정 경로 파싱 오류를 수정했습니다. Compose 리스트 형식에서 값에 따옴표가 포함되면 Spring이 파일 위치를 문자열 그대로 해석하지 못해 ConfigDataLocationResolver가 경로를 정상 처리하지 못하는 문제를 해결합니다.
  • 추가 설정 파일 경로의 프로필 치환 일관화: SPRING_CONFIG_ADDITIONAL_LOCATION 변수의 프로필 치환에 기본값(dev)을 명시하여 SPRING_PROFILES_ACTIVE와 동일한 ${ACTIVE_PROFILE:-dev} 규칙을 따르도록 했습니다. 이는 프로필이 비어 있는 상황에서 경로 해석의 불일치를 방지하고, 기본 실행 시에도 /config/application-dev.yml 경로가 안정적으로 계산되도록 하여 부팅 실패 가능성을 낮춥니다.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • docker-compose.yml
    • SPRING_PROFILES_ACTIVE 및 SPRING_CONFIG_ADDITIONAL_LOCATION 환경 변수에서 불필요한 따옴표를 제거했습니다.
    • SPRING_CONFIG_ADDITIONAL_LOCATION 환경 변수에 ${ACTIVE_PROFILE:-dev} 형식으로 기본 프로필(dev)을 명시하여 프로필 치환 로직을 일관되게 변경했습니다.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

이 PR은 docker-compose.yml 파일에서 Spring 애플리케이션의 환경 변수 설정 방식을 수정합니다. 기존의 불필요한 따옴표를 제거하여 런타임 시 환경 변수 파싱 오류를 해결하고, SPRING_CONFIG_ADDITIONAL_LOCATION에도 기본 프로필(dev)을 명시하여 SPRING_PROFILES_ACTIVE와의 일관성을 확보했습니다. 이를 통해 설정의 안정성과 예측 가능성을 높였습니다. 추가적으로, 환경 변수 정의 방식을 배열에서 맵 형식으로 변경하여 가독성을 향상시키는 것을 제안합니다.

Align the compose environment definition with the reviewed key-value format and document how external profile-specific Spring config files must be prepared so deployment setup is less error-prone.
@zionhann zionhann changed the title 도커 컴포즈 환경변수 포맷 오류 수정 도커 컴포즈 환경변수 포맷 및 설정 가이드 정리 Mar 6, 2026
@zionhann zionhann merged commit 3bb546d into HandongSF:main Mar 6, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant