You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
PostgreSQL 연결 테스트를 위해 별도의 docker-compose-postgres.yml 파일을 추가했습니다.
초기화 스크립트 실행 및 데이터 퍼시스턴스를 지원하도록 설정했습니다.
또한 .env.template에서 PostgreSQL 관련 환경변수 prefix가 잘못되어 있던 부분을 수정했습니다.
변경 사항
docker-compose-postgres.yml 추가
PostgreSQL 15 이미지 사용
포트: 5432:5432 매핑
환경변수: POSTGRES_USER, POSTGRES_PASSWORD, POSTGRES_DB, TZ, LANG
볼륨:
postgres_data:/var/lib/postgresql/data
./postgres/init:/docker-entrypoint-initdb.d/init.sql
컨테이너명: postgres
.env.template 수정
POSTGRES_HOST, POSTGRES_PORT → POSTGRESQL_HOST, POSTGRESQL_PORT 등으로 변경
DB_TYPE=postgresql 과 일관되게 prefix를 맞춤
실행 방법
# PostgreSQL 컨테이너 실행
docker compose -f docker-compose-postgres.yml up -d
# 종료 및 볼륨 유지
docker compose -f docker-compose-postgres.yml down
기대 효과
로컬 환경에서 PostgreSQL을 쉽게 띄워 연결 테스트 가능
.env.template 오타 수정으로 환경변수 기반 DB 연결이 정상적으로 동작