서비스별 데이터베이스 환경 변수 적용#58
Open
eajnoeyeel wants to merge 1 commit into
Open
Conversation
- Changed from generic POSTGRES_DB/USER/PASSWORD to DB_GAME_NAME/USER/PASSWORD - Ensures game service connects to its own database (game_db) instead of shared mydatabase - Fixes issue where all services were connecting to the same database - Part of microservices database isolation improvements
There was a problem hiding this comment.
Pull Request Overview
This PR renames PostgreSQL database environment variable names to use a more specific naming convention. The environment variables for database name, user, and password are changed from generic POSTGRES_* prefixes to DB_GAME_* prefixes to better reflect the purpose of this specific database.
- Changed database name, user, and password environment variable names from
POSTGRES_DB/USER/PASSWORDtoDB_GAME_NAME/USER/PASSWORD
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
📌 변경 내용 요약
POSTGRES_DB,POSTGRES_USER,POSTGRES_PASSWORD)를각 서비스 전용 환경 변수(
DB_GAME_NAME,DB_GAME_USER,DB_GAME_PASSWORD)로 분리했습니다.모든 서비스가 같은 DB(
mydatabase)를 공유하던 문제를 해결했습니다.🔗 관련 이슈
💡 주요 변경 사항
config/settings.py에서 서비스별 DB 환경 변수로 변경POSTGRES_DB→DB_GAME_NAMEPOSTGRES_USER→DB_GAME_USERPOSTGRES_PASSWORD→DB_GAME_PASSWORD🧩 리뷰어 참고 사항
.env파일의 값이 변경되었으므로, 로컬 환경에서 테스트 시.env를 새로 적용해야 합니다.mydatabase)는 더 이상 사용하지 않으며,game_db데이터베이스가 생성됩니다.docker exec game python manage.py migrate✅ 테스트 방법
Game 서비스가 올바른 데이터베이스에 연결되는지 확인:
게임 관련 API 테스트 (예시):
# 토너먼트 목록 조회 등 curl http://localhost/api/game/tournaments/