-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
44 lines (34 loc) · 1.46 KB
/
Dockerfile
File metadata and controls
44 lines (34 loc) · 1.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
FROM alpine:latest
ARG PB_VERSION=0.37.3
ARG TARGETARCH
# Update default Alpine Linux packages that may have know CVE.
RUN apk update
RUN apk upgrade
# Add cli utils that will allow this workflow to fetch the Pocketbase package.
RUN apk add --no-cache \
curl \
unzip \
ca-certificates
# TARGETARCH does not supply the exact values we need to we need to do a conditional in the same run command X(
RUN case "$TARGETARCH" in \
amd64) ARCH=amd64 ;; \
arm64) ARCH=arm64 ;; \
arm) ARCH=armv7 ;; \
*) echo "Unsupported TARGETARCH: $TARGETARCH" && exit 1 ;; \
esac && \
curl -fsSL -o /tmp/pb.zip "https://github.com/pocketbase/pocketbase/releases/download/v${PB_VERSION}/pocketbase_${PB_VERSION}_linux_${ARCH}.zip" && \
unzip /tmp/pb.zip -d /pb/ && \
rm /tmp/pb.zip && \
echo "Downloaded Pocketbase Version: ${PB_VERSION} Arch: ${ARCH}"
# download and unzip PocketBase x86 64-bit
# ADD https://github.com/pocketbase/pocketbase/releases/download/v${PB_VERSION}/pocketbase_${PB_VERSION}_linux_${TARGETARCH}.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
# Unzip may contain a known CVE so lets get rid of it since we no longer need it.
RUN apk del unzip
EXPOSE 8080
# start PocketBase
CMD ["/pb/pocketbase", "serve", "--http=0.0.0.0:8080"]