diff options
Diffstat (limited to 'build/postgrest')
-rw-r--r-- | build/postgrest/Dockerfile | 9 | ||||
-rwxr-xr-x | build/postgrest/entrypoint.sh | 20 | ||||
-rw-r--r-- | build/postgrest/postgrest.tar.xz | bin | 0 -> 3648348 bytes |
3 files changed, 29 insertions, 0 deletions
diff --git a/build/postgrest/Dockerfile b/build/postgrest/Dockerfile new file mode 100644 index 0000000..62b8a2e --- /dev/null +++ b/build/postgrest/Dockerfile @@ -0,0 +1,9 @@ +FROM alpine:3.19 +COPY ./postgrest.tar.xz /tmp/postgrest.tar.xz +RUN tar xJf /tmp/postgrest.tar.xz -C /tmp +RUN mv /tmp/postgrest /usr/local/bin/postgrest +RUN rm /tmp/postgrest.tar.xz +COPY ./entrypoint.sh /usr/local/bin/entrypoint.sh +CMD ["/usr/local/bin/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 diff --git a/build/postgrest/postgrest.tar.xz b/build/postgrest/postgrest.tar.xz Binary files differnew file mode 100644 index 0000000..33c2b2d --- /dev/null +++ b/build/postgrest/postgrest.tar.xz |