From 944b6b0526032ad8c1b4a2612d6723bec75e0e4c Mon Sep 17 00:00:00 2001 From: Freya Murphy Date: Fri, 29 Mar 2024 22:29:56 -0400 Subject: start database (user and post), and initial barebones home page --- build/postgrest/entrypoint.sh | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100755 build/postgrest/entrypoint.sh (limited to 'build/postgrest/entrypoint.sh') diff --git a/build/postgrest/entrypoint.sh b/build/postgrest/entrypoint.sh new file mode 100755 index 0000000..d375769 --- /dev/null +++ b/build/postgrest/entrypoint.sh @@ -0,0 +1,20 @@ +#!/bin/sh + +mkdir /etc/postgrest.d +config=/etc/postgrest.d/postgrest.conf + +PGRST_DB_URI="postgres://authenticator:postgrest@db:5432/$POSTGRES_DB" +PGRST_ROLE="rest_anon" +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 + +exec /usr/local/bin/postgrest $config -- cgit v1.2.3-freya