Skip to content

Commit 1a33a78

Browse files
committed
chore: Postgres 연결 테스트용 docker-compose 추가 및 .env.template 수정
1 parent 9378ef4 commit 1a33a78

File tree

3 files changed

+32
-7
lines changed

3 files changed

+32
-7
lines changed

.env.example

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -124,13 +124,13 @@ CLICKHOUSE_DATABASE=default
124124
# ORACLE_DATABASE=_
125125
# ORACLE_SERVICE_NAME=_
126126

127-
# postgres
128-
# DB_TYPE=postgres
129-
# POSTGRES_HOST=_
130-
# POSTGRES_PORT=5432
131-
# POSTGRES_USER=_
132-
# POSTGRES_PASSWORD=_
133-
# POSTGRES_DATABASE=_
127+
# postgresql
128+
# DB_TYPE=postgresql
129+
# POSTGRESQL_HOST=_
130+
# POSTGRESQL_PORT=5432
131+
# POSTGRESQL_USER=_
132+
# POSTGRESQL_PASSWORD=_
133+
# POSTGRESQL_DATABASE=_
134134

135135
# snowflake
136136
# DB_TYPE=snowflake

docker/docker-compose-postgres.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# docker compose -f docker-compose-postgres.yml up
2+
# docker compose -f docker-compose-postgres.yml down
3+
4+
services:
5+
postgres:
6+
image: postgres:15
7+
hostname: postgres
8+
container_name: postgres
9+
restart: always
10+
ports:
11+
- "5432:5432"
12+
environment:
13+
POSTGRES_USER: root
14+
POSTGRES_PASSWORD: rootpassword
15+
POSTGRES_DB: postgres
16+
TZ: Asia/Seoul
17+
LANG: en_US.utf8
18+
volumes:
19+
- postgres_data:/var/lib/postgresql/data
20+
- ./postgres/init:/docker-entrypoint-initdb.d/init.sql
21+
22+
volumes:
23+
postgres_data:

docker/postgres/init/init.sql

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
CREATE DATABASE lang2sql;
2+
CREATE USER lang2sql WITH PASSWORD 'lang2sqlpassword';

0 commit comments

Comments
 (0)