From dea68fd793cde6403ecca849fdc33a5b9a825abd Mon Sep 17 00:00:00 2001 From: Clemens Geibel Date: Thu, 19 Nov 2020 12:47:43 +0100 Subject: [PATCH] Added entrypoint and pg_pass creation script --- infrastrucure/docker/image/Dockerfile | 4 ++++ infrastrucure/docker/image/resources/create_pg_pass.sh | 3 +++ infrastrucure/docker/image/resources/entrypoint.sh | 1 + 3 files changed, 8 insertions(+) create mode 100644 infrastrucure/docker/image/resources/create_pg_pass.sh create mode 100644 infrastrucure/docker/image/resources/entrypoint.sh diff --git a/infrastrucure/docker/image/Dockerfile b/infrastrucure/docker/image/Dockerfile index 4e8a762..ec46356 100644 --- a/infrastrucure/docker/image/Dockerfile +++ b/infrastrucure/docker/image/Dockerfile @@ -21,3 +21,7 @@ RUN apt-get update # Install the latest version of PostgreSQL. # If you want a specific version, use 'postgresql-12' or similar instead of 'postgresql': RUN apt-get -y install postgresql + + +# Prepare Entrypoint Script +ADD resources /tmp/resources \ No newline at end of file diff --git a/infrastrucure/docker/image/resources/create_pg_pass.sh b/infrastrucure/docker/image/resources/create_pg_pass.sh new file mode 100644 index 0000000..3a5a3bd --- /dev/null +++ b/infrastrucure/docker/image/resources/create_pg_pass.sh @@ -0,0 +1,3 @@ +echo "${POSTGRES_HOST}:${POSTGRES_DB}:${POSTGRES_USER}:${DB_PASSWORD}" > /root/.pg_pass +echo "${POSTGRES_HOST}:template1:${POSTGRES_USER}:${DB_PASSWORD}" >> /root/.pg_pass +chmod 0600 /root/.pg_pass diff --git a/infrastrucure/docker/image/resources/entrypoint.sh b/infrastrucure/docker/image/resources/entrypoint.sh new file mode 100644 index 0000000..2ef8157 --- /dev/null +++ b/infrastrucure/docker/image/resources/entrypoint.sh @@ -0,0 +1 @@ +./create_pg_pass.sh \ No newline at end of file