Skip to content

Conversation

@ParkGyeongTae
Copy link
Contributor

#️⃣ Issue Number

📝 요약(Summary)

  • PostgreSQL 연결 테스트 환경을 위해 docker-compose-postgres.yml 파일을 추가했습니다.
  • .env.template 내 PostgreSQL 관련 환경변수 prefix가 잘못되어 있던 부분을 수정했습니다.
  • 로컬에서 손쉽게 Postgres를 실행하고 연결을 검증할 수 있습니다.

💬 To Reviewers (선택)

  • Docker Compose 설정 및 .env.template 변경된 prefix(POSTGRESQL_...)가 일관성 있게 적용되었는지 확인 부탁드립니다.

PR Checklist

  • PostgreSQL 컨테이너 정상 기동 및 접속 테스트 완료
  • .env.template 환경변수 수정 후 DB 연결 정상 동작 확인

reference) How to Code Review

  • 따봉(👍): 리뷰어가 리뷰이의 코드에서 칭찬의 의견을 남기고 싶을 때 사용합니다.
  • 느낌표(❗): 리뷰어가 리뷰이에게 필수적으로 코드 수정을 요청할 때 사용합니다.
  • 물음표 (❓): 리뷰어가 리뷰이에게 의견을 물어보고 싶을 때 사용합니다.
  • 알약 (💊): 리뷰어가 리뷰이의 코드에서 개선된 방법을 제안하지만 그것의 반영이 필수까지는 아닐 때 사용합니다.

@ParkGyeongTae ParkGyeongTae self-assigned this Oct 4, 2025
Copy link
Collaborator

@ehddnr301 ehddnr301 left a comment

Choose a reason for hiding this comment

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

💬 제가 내일아침에 테스트해보겠습니다아...! 이 PR과는 번외인 이야기이지만 Postgres 부분의 지원이 잘되면, #180 의 내용중에 json을 활용하는 부분이 대체될 수 있을것 같네요!

LANG: en_US.utf8
volumes:
- postgres_data:/var/lib/postgresql/data
- ./postgres/init:/docker-entrypoint-initdb.d/init.sql
Copy link
Collaborator

Choose a reason for hiding this comment

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

docker compose -f docker-compose-postgres.yml up 명령어로 실행했을때 init.sql 이 적용되지 않는것으로 확인됩니다.

실행하면 psql:/docker-entrypoint-initdb.d/init.sql: error: could not read from input file: Is a directory 이런 로그가 출력되는데

- ./postgres/init:/docker-entrypoint-initdb.d 이렇게 수정되어야 하지않을까 생각이 듭니다아!

  • 아래 명령어로 실제 lang2sql 데이터베이스가 생성되지 않았음을 확인했습니다.
docker exec -it postgres bash
psql -U root -d postgres
\l

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@ehddnr301
수정 후 아래 방법으로 수정 확인했습니다~! 감사합니다!

# 1. 기존 볼륨 삭제
docker volume rm docker_postgres_data

# 2. 도커 컴포즈 실행
docker compose -f docker-compose-postgres.yml up

# 3. 데이터베이스 확인
docker exec -it postgres psql -U postgres -l

   Name    |  Owner   | Encoding |  Collate   |   Ctype    | ICU Locale | Locale Provider |   Access privileges
-----------+----------+----------+------------+------------+------------+-----------------+-----------------------
 lang2sql  | postgres | UTF8     | en_US.utf8 | en_US.utf8 |            | libc            | =Tc/postgres         +
           |          |          |            |            |            |                 | postgres=CTc/postgres+
           |          |          |            |            |            |                 | lang2sql=CTc/postgres
 postgres  | postgres | UTF8     | en_US.utf8 | en_US.utf8 |            | libc            |
 template0 | postgres | UTF8     | en_US.utf8 | en_US.utf8 |            | libc            | =c/postgres          +
           |          |          |            |            |            |                 | postgres=CTc/postgres
 template1 | postgres | UTF8     | en_US.utf8 | en_US.utf8 |            | libc            | =c/postgres          +
           |          |          |            |            |            |                 | postgres=CTc/postgres
 test      | postgres | UTF8     | en_US.utf8 | en_US.utf8 |            | libc            | =Tc/postgres         +
           |          |          |            |            |            |                 | postgres=CTc/postgres+
           |          |          |            |            |            |                 | test=CTc/postgres

Copy link
Collaborator

@ehddnr301 ehddnr301 left a comment

Choose a reason for hiding this comment

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

👍 감사합니다!!

@ParkGyeongTae ParkGyeongTae merged commit 36a9b66 into master Oct 5, 2025
1 check passed
@ehddnr301 ehddnr301 deleted the 185-add-postgres-compose branch October 11, 2025 11:04
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.

3 participants