Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -124,13 +124,13 @@ CLICKHOUSE_DATABASE=default
# ORACLE_DATABASE=_
# ORACLE_SERVICE_NAME=_

# postgres
# DB_TYPE=postgres
# POSTGRES_HOST=_
# POSTGRES_PORT=5432
# POSTGRES_USER=_
# POSTGRES_PASSWORD=_
# POSTGRES_DATABASE=_
# postgresql
# DB_TYPE=postgresql
# POSTGRESQL_HOST=_
# POSTGRESQL_PORT=5432
# POSTGRESQL_USER=_
# POSTGRESQL_PASSWORD=_
# POSTGRESQL_DATABASE=_

# snowflake
# DB_TYPE=snowflake
Expand Down
23 changes: 23 additions & 0 deletions docker/docker-compose-postgres.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# docker compose -f docker-compose-postgres.yml up
# docker compose -f docker-compose-postgres.yml down

services:
postgres:
image: postgres:15
hostname: postgres
container_name: postgres
restart: always
ports:
- "5432:5432"
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: postgres
TZ: Asia/Seoul
LANG: en_US.utf8
volumes:
- postgres_data:/var/lib/postgresql/data
- ./postgres/init:/docker-entrypoint-initdb.d

volumes:
postgres_data:
2 changes: 2 additions & 0 deletions docker/postgres/init/001_create_database.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
CREATE DATABASE lang2sql;
CREATE DATABASE test;
5 changes: 5 additions & 0 deletions docker/postgres/init/002_create_user_and_grant.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
CREATE USER lang2sql WITH PASSWORD 'lang2sqlpassword';
GRANT ALL PRIVILEGES ON DATABASE lang2sql TO lang2sql;

CREATE USER test WITH PASSWORD 'testpassword';
GRANT ALL PRIVILEGES ON DATABASE test TO test;