Skip to content

Instantly share code, notes, and snippets.

@k4zek4ge
Created October 9, 2023 17:53
Show Gist options
  • Save k4zek4ge/3c3f7f25877fd0332bef3fbdc0645b76 to your computer and use it in GitHub Desktop.
Save k4zek4ge/3c3f7f25877fd0332bef3fbdc0645b76 to your computer and use it in GitHub Desktop.
[Self host pocketbase with Docker and Docker Compose] #pocketbase https://github.com/pocketbase/pocketbase/discussions/3279
1- create a docker file
FROM alpine:latest
ARG PB_VERSION=0.18.1
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
VOLUME /pb/pb_data
EXPOSE 8080
# start PocketBase
CMD ["/pb/pocketbase", "serve", "--http=0.0.0.0:8080"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment