diff options
| author | Jan Tuomi <jan.tuomi@eficode.com> | 2020-04-26 16:40:34 +0300 |
|---|---|---|
| committer | Jan Tuomi <jan.tuomi@eficode.com> | 2020-04-26 16:40:34 +0300 |
| commit | 449ebe5164ad9d2ba1e7d61bbae8e4101b703490 (patch) | |
| tree | e334b1bd0f0999da9cfd36d0502578b2cac102af /postgrest | |
| parent | 55f725a502011155f0943f2340ef3763f014ccc0 (diff) | |
Stuff
Diffstat (limited to 'postgrest')
| -rw-r--r-- | postgrest/Dockerfile | 4 | ||||
| -rw-r--r-- | postgrest/migrations/003-roles.sql | 4 | ||||
| -rw-r--r-- | postgrest/postgrest.conf | 2 | ||||
| -rwxr-xr-x | postgrest/start-postgrest.sh | 2 |
4 files changed, 8 insertions, 4 deletions
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 |
