From 9dacf1f79649087eae91bf7118705bec2013300f Mon Sep 17 00:00:00 2001 From: pluja Date: Sun, 18 Feb 2024 22:45:54 +0100 Subject: [PATCH] Build pocketbase from source --- docker-compose.yml | 11 ++++++++--- pocketbase.Dockerfile | 22 ++++++++++++++++++++++ 2 files changed, 30 insertions(+), 3 deletions(-) create mode 100644 pocketbase.Dockerfile diff --git a/docker-compose.yml b/docker-compose.yml index 63ac9b7..c9d8c53 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -8,6 +8,7 @@ networks: volumes: pb_data: {} pb_public: {} + pb_migrations: {} services: crawler: @@ -27,12 +28,15 @@ services: caddy.reverse_proxy: "{{upstreams 4488}}" pocketbase: - image: ghcr.io/muchobien/pocketbase:latest + build: + context: . + dockerfile: pocketbase.Dockerfile container_name: kycnotme-pocketbase restart: unless-stopped volumes: - - pb_data:/pb_data - - pb_public:/pb_public + - pb_data:/pb/pb_data + - pb_public:/pb/pb_public + - pb_migrations:/pb/pb_migrations networks: caddy: {} default: @@ -42,6 +46,7 @@ services: labels: caddy: "${PB_DOMAIN}" caddy.reverse_proxy: "{{upstreams 8090}}" + caddy.request_body.max_size: 10MB healthcheck: #optional (recommended) since v0.10.0 test: wget --no-verbose --tries=1 --spider http://localhost:8090/api/health || exit 1 interval: 5s diff --git a/pocketbase.Dockerfile b/pocketbase.Dockerfile new file mode 100644 index 0000000..603cf84 --- /dev/null +++ b/pocketbase.Dockerfile @@ -0,0 +1,22 @@ +FROM alpine:latest + +ARG PB_VERSION=0.21.3 + +RUN apk add --no-cache \ + unzip \ + ca-certificates + +# download and unzip PocketBase +ADD https://github.com/pocketbase/pocketbase/releases/download/v${PB_VERSION}/pocketbase_${PB_VERSION}_linux_amd64.zip /tmp/pb.zip +RUN unzip /tmp/pb.zip -d /pb/ + +# uncomment to copy the local pb_migrations dir into the image +# COPY ./pb_migrations /pb/pb_migrations + +# uncomment to copy the local pb_hooks dir into the image +# COPY ./pb_hooks /pb/pb_hooks + +EXPOSE 8080 + +# start PocketBase +CMD ["/pb/pocketbase", "serve", "--http=0.0.0.0:8080"] \ No newline at end of file