From 449ebe5164ad9d2ba1e7d61bbae8e4101b703490 Mon Sep 17 00:00:00 2001 From: Jan Tuomi Date: Sun, 26 Apr 2020 16:40:34 +0300 Subject: Stuff --- postgrest/Dockerfile | 4 +++- postgrest/migrations/003-roles.sql | 4 ++-- postgrest/postgrest.conf | 2 +- postgrest/start-postgrest.sh | 2 ++ 4 files changed, 8 insertions(+), 4 deletions(-) (limited to 'postgrest') diff --git a/postgrest/Dockerfile b/postgrest/Dockerfile index 5e6abac..7aafc88 100644 --- a/postgrest/Dockerfile +++ b/postgrest/Dockerfile @@ -1,6 +1,8 @@ FROM ubuntu:18.04 WORKDIR /app -RUN apt-get update && apt-get install -y libpq-dev gettext +RUN apt-get update && apt-get install -y libpq-dev gettext postgresql-client ADD postgrest postgrest.conf start-postgrest.sh ./ +ADD migrations ./migrations + CMD ["./start-postgrest.sh"] diff --git a/postgrest/migrations/003-roles.sql b/postgrest/migrations/003-roles.sql index 86e49f0..9ad6685 100644 --- a/postgrest/migrations/003-roles.sql +++ b/postgrest/migrations/003-roles.sql @@ -1,5 +1,5 @@ --- authenticator role -create role authenticator noinherit login password 'mysecretpassword'; +-- authenticator role. created manually, see README.md +-- create role authenticator noinherit login password '${POSTGREST_PASSWORD}'; -- web_anon role create role web_anon nologin; diff --git a/postgrest/postgrest.conf b/postgrest/postgrest.conf index 638b528..9c1b675 100644 --- a/postgrest/postgrest.conf +++ b/postgrest/postgrest.conf @@ -1,4 +1,4 @@ -db-uri = "postgres://authenticator:mysecretpassword@postgres:5432/postgres" +db-uri = "postgres://authenticator:${POSTGREST_PASSWORD}@postgres:5432/postgres" db-schema = "api" db-anon-role = "web_anon" jwt-secret = "${JWT_SECRET}" diff --git a/postgrest/start-postgrest.sh b/postgrest/start-postgrest.sh index 5995898..f74e180 100755 --- a/postgrest/start-postgrest.sh +++ b/postgrest/start-postgrest.sh @@ -1,5 +1,7 @@ #!/bin/bash +# Insert env vars into postgrest.conf envsubst < postgrest.conf > postgrest.conf.tmp mv postgrest.conf.tmp postgrest.conf + ./postgrest postgrest.conf -- cgit v1.3