2024-03-30 02:29:56 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
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"
|
2024-05-23 16:15:02 +00:00
|
|
|
{
|
|
|
|
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
|
2024-03-30 02:29:56 +00:00
|
|
|
|
2024-05-23 16:15:02 +00:00
|
|
|
exec /usr/local/bin/postgrest "$config"
|