Skip to content

Commit 36a9b66

Browse files
Merge pull request #186 from CausalInferenceLab/185-add-postgres-compose
chore: Postgres 연결 테스트용 docker-compose 추가 및 .env.template 수정
2 parents 9378ef4 + 29f8126 commit 36a9b66

File tree

4 files changed

+37
-7
lines changed

4 files changed

+37
-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: postgres
14+
POSTGRES_PASSWORD: postgres
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
21+
22+
volumes:
23+
postgres_data:
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
CREATE DATABASE lang2sql;
2+
CREATE DATABASE test;
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
CREATE USER lang2sql WITH PASSWORD 'lang2sqlpassword';
2+
GRANT ALL PRIVILEGES ON DATABASE lang2sql TO lang2sql;
3+
4+
CREATE USER test WITH PASSWORD 'testpassword';
5+
GRANT ALL PRIVILEGES ON DATABASE test TO test;

0 commit comments

Comments
 (0)