Archived
1
0
Fork 0

Pocketbase: New Container!

This commit is contained in:
J. Elfring 2022-07-23 12:45:12 +02:00
parent 8179cf4b87
commit 6250915323
3 changed files with 45 additions and 0 deletions

View file

@ -18,3 +18,7 @@ services:
agate:
build: ./agate
image: elfrinjo/agate:latest
pocketbase:
build: ./pocketbase
image: elfrinjo/pocketbase:latest

28
pocketbase/Dockerfile Normal file
View file

@ -0,0 +1,28 @@
FROM alpine:latest
LABEL maintainer "J. Elfring <code@elfring.ms>"
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" ]

13
pocketbase/pocketbase.sh Normal file
View file

@ -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