Pocketbase: New Container!
This commit is contained in:
parent
8179cf4b87
commit
6250915323
3 changed files with 45 additions and 0 deletions
|
@ -18,3 +18,7 @@ services:
|
|||
agate:
|
||||
build: ./agate
|
||||
image: elfrinjo/agate:latest
|
||||
|
||||
pocketbase:
|
||||
build: ./pocketbase
|
||||
image: elfrinjo/pocketbase:latest
|
||||
|
|
28
pocketbase/Dockerfile
Normal file
28
pocketbase/Dockerfile
Normal 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
13
pocketbase/pocketbase.sh
Normal 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
|
Reference in a new issue