From 6250915323a9a3aa8c6188b80b9e52df6d2d58c4 Mon Sep 17 00:00:00 2001 From: "J. Elfring" Date: Sat, 23 Jul 2022 12:45:12 +0200 Subject: [PATCH] Pocketbase: New Container! --- docker-compose.yaml | 4 ++++ pocketbase/Dockerfile | 28 ++++++++++++++++++++++++++++ pocketbase/pocketbase.sh | 13 +++++++++++++ 3 files changed, 45 insertions(+) create mode 100644 pocketbase/Dockerfile create mode 100644 pocketbase/pocketbase.sh diff --git a/docker-compose.yaml b/docker-compose.yaml index 8664ebd..d9c4d40 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -18,3 +18,7 @@ services: agate: build: ./agate image: elfrinjo/agate:latest + + pocketbase: + build: ./pocketbase + image: elfrinjo/pocketbase:latest diff --git a/pocketbase/Dockerfile b/pocketbase/Dockerfile new file mode 100644 index 0000000..40ba84e --- /dev/null +++ b/pocketbase/Dockerfile @@ -0,0 +1,28 @@ +FROM alpine:latest +LABEL maintainer "J. Elfring " + +RUN apk add --no-cache \ + ca-certificates \ + curl \ + unzip + +RUN mkdir /app \ + && mkdir /data \ + && chown daemon /data \ + && downloadurl=$(curl -s https://api.github.com/repos/pocketbase/pocketbase/releases/latest \ + | grep "browser_download_url" \ + | grep "linux_amd64" \ + | cut -d : -f 2,3 \ + | tr -d '\" ' ) \ + && curl --location --silent --output /tmp/pocketbase.zip \ + $downloadurl \ + && unzip -d /app /tmp/pocketbase.zip \ + && rm /tmp/pocketbase.zip \ + && chmod +x /app/pocketbase +ADD ./pocketbase.sh /app + +VOLUME /data +USER daemon +EXPOSE 8090 + +CMD [ "/bin/sh", "/app/pocketbase.sh" ] diff --git a/pocketbase/pocketbase.sh b/pocketbase/pocketbase.sh new file mode 100644 index 0000000..4683532 --- /dev/null +++ b/pocketbase/pocketbase.sh @@ -0,0 +1,13 @@ + +set -x +set -e + +if [ _${encryptionKey} != _ ] +then + enc="--encryptionEnv encryptionKey" +else + enc="" +fi + +/app/pocketbase ${enc} --dir /data migrate +/app/pocketbase ${enc} --dir /data serve