From 0d2ff205575827f2a318f1ae6b7a2cb31f54427c Mon Sep 17 00:00:00 2001 From: Piotr Biernat Date: Mon, 22 May 2023 00:05:33 +0200 Subject: [PATCH] Add init db sql file --- deploy/db_migrations/init.sql | 3 +++ deploy/egommerce-stack.yml | 1 + 2 files changed, 4 insertions(+) create mode 100644 deploy/db_migrations/init.sql diff --git a/deploy/db_migrations/init.sql b/deploy/db_migrations/init.sql new file mode 100644 index 0000000..a125304 --- /dev/null +++ b/deploy/db_migrations/init.sql @@ -0,0 +1,3 @@ +CREATE USER egommerce; +CREATE DATABASE egommerce; +GRANT ALL PRIVILEGES ON DATABASE egommerce TO egommerce; \ No newline at end of file diff --git a/deploy/egommerce-stack.yml b/deploy/egommerce-stack.yml index 717b6ce..47fdb80 100644 --- a/deploy/egommerce-stack.yml +++ b/deploy/egommerce-stack.yml @@ -107,6 +107,7 @@ services: - POSTGRES_PASSWORD volumes: - postgres_data:/var/lib/postgresql/data + - ./db_migrations/init.sql:/docker-entrypoint-initdb.d/ networks: - postgres-db-network - api-logger-network