docker-compose env_file 추가#24
Merged
Merged
Conversation
There was a problem hiding this comment.
Code Review
This pull request updates the docker-compose.yml file to include an .env file and removes the hardcoded SECONDARY_JWT_SECRET. The review feedback suggests using variable interpolation in the environment section to ensure that values from the .env file can properly override defaults, as hardcoded values in the environment block currently take precedence over the env_file definitions.
Comment on lines
+6
to
11
| env_file: | ||
| - .env | ||
| environment: | ||
| PORT: "1234" | ||
| SECONDARY_JWT_SECRET: "change-me" | ||
| Y_LEVELDB_PATH: "/data/y-leveldb" | ||
| MAX_USERS_PER_ROOM: "20" |
There was a problem hiding this comment.
현재 environment 섹션에 일부 값이 하드코딩되어 있어 .env 파일에 동일한 변수를 정의하더라도 무시되는 구조입니다 (Docker Compose에서 environment 섹션은 env_file보다 우선순위가 높습니다). 또한 필수 변수인 SECONDARY_JWT_SECRET이 명시되지 않아 가독성이 떨어집니다. 아래와 같이 변수 참조 방식을 사용하면 .env를 통한 유연한 설정이 가능해지며, 필요한 환경 변수 목록을 명확히 파악할 수 있습니다.
env_file:
- .env
environment:
PORT: "${PORT:-1234}"
SECONDARY_JWT_SECRET: "${SECONDARY_JWT_SECRET}"
Y_LEVELDB_PATH: "${Y_LEVELDB_PATH:-/data/y-leveldb}"
MAX_USERS_PER_ROOM: "${MAX_USERS_PER_ROOM:-20}"
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.