summaryrefslogtreecommitdiff
path: root/build/postgrest/entrypoint.sh
diff options
context:
space:
mode:
Diffstat (limited to 'build/postgrest/entrypoint.sh')
-rwxr-xr-xbuild/postgrest/entrypoint.sh19
1 files changed, 10 insertions, 9 deletions
diff --git a/build/postgrest/entrypoint.sh b/build/postgrest/entrypoint.sh
index d375769..71b433d 100755
--- a/build/postgrest/entrypoint.sh
+++ b/build/postgrest/entrypoint.sh
@@ -1,6 +1,5 @@
#!/bin/sh
-mkdir /etc/postgrest.d
config=/etc/postgrest.d/postgrest.conf
PGRST_DB_URI="postgres://authenticator:postgrest@db:5432/$POSTGRES_DB"
@@ -9,12 +8,14 @@ PGRST_SCHEMA="api"
rm -fr "$config"
touch "$config"
-printf 'db-uri = "%s"\n' "$PGRST_DB_URI" >> $config
-printf 'db-anon-role = "%s"\n' "$PGRST_ROLE" >> $config
-printf 'db-schemas = "%s"\n' "$PGRST_SCHEMA" >> $config
-printf 'jwt-secret = "%s"\n' "$JWT_SECRET" >> $config
-printf 'jwt-secret-is-base64 = false\n' >> $config
-printf 'server-host = "*"\n' >> $config
-printf 'server-port = 3000\n' >> $config
+{
+ printf 'db-uri = "%s"\n' "$PGRST_DB_URI";
+ printf 'db-anon-role = "%s"\n' "$PGRST_ROLE";
+ printf 'db-schemas = "%s"\n' "$PGRST_SCHEMA";
+ printf 'jwt-secret = "%s"\n' "$JWT_SECRET";
+ printf 'jwt-secret-is-base64 = false\n';
+ printf 'server-host = "*"\n';
+ printf 'server-port = 3000\n';
+} >> $config
-exec /usr/local/bin/postgrest $config
+exec /usr/local/bin/postgrest "$config"