[add] Init from base
This commit is contained in:
1
database/.dockerignore
Normal file
1
database/.dockerignore
Normal file
@@ -0,0 +1 @@
|
||||
Dockerfile
|
||||
7
database/Dockerfile
Normal file
7
database/Dockerfile
Normal file
@@ -0,0 +1,7 @@
|
||||
FROM postgres:12-alpine
|
||||
|
||||
# So that the timezone can be sent with the TZ environment
|
||||
RUN apk add --no-cache tzdata
|
||||
|
||||
# Starting scripts
|
||||
ADD . /docker-entrypoint-initdb.d
|
||||
9
database/docker-init.sh
Executable file
9
database/docker-init.sh
Executable file
@@ -0,0 +1,9 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
cd /docker-entrypoint-initdb.d/
|
||||
|
||||
find "$PWD" -type f -name "*.sql" | sort | \
|
||||
while read l; do
|
||||
# The env variables are set by docker-compose and taken from the .env file
|
||||
psql -d $POSTGRES_DB -U $POSTGRES_USER -f "$d/$l";
|
||||
done
|
||||
Reference in New Issue
Block a user