From 32ce40544fa4a2b4268ee6da253059197b5b0fbf Mon Sep 17 00:00:00 2001 From: Bram Suurd <78373894+BramSuurdje@users.noreply.github.com> Date: Tue, 21 May 2024 19:08:08 +0200 Subject: [PATCH] Add Docker configuration files for PocketBase service --- docker-compose.yml | 8 ++++++++ dockerfile | 22 ++++++++++++++++++++++ example.env | 2 +- pb_data/.gitkeep | 0 4 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 docker-compose.yml create mode 100644 dockerfile create mode 100644 pb_data/.gitkeep diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..dc5ed03 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,8 @@ +services: + pocketbase: + build: . + ports: + - "8080:8080" + volumes: + - ./pb_data:/pb/pb_data + restart: unless-stopped` \ No newline at end of file diff --git a/dockerfile b/dockerfile new file mode 100644 index 0000000..9593f68 --- /dev/null +++ b/dockerfile @@ -0,0 +1,22 @@ +FROM alpine:latest + +ARG PB_VERSION=0.22.12 + +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 diff --git a/example.env b/example.env index f9d1993..66d23fa 100644 --- a/example.env +++ b/example.env @@ -1 +1 @@ -NEXT_PUBLIC_POCKETBASE_URL= \ No newline at end of file +NEXT_PUBLIC_POCKETBASE_URL=http://localhost:8080 \ No newline at end of file diff --git a/pb_data/.gitkeep b/pb_data/.gitkeep new file mode 100644 index 0000000..e69de29