fix: use app user

This commit is contained in:
Bart van der Braak 2024-02-19 19:47:35 +01:00
parent 1fc97c608c
commit 4962e961a9

View file

@ -1,23 +1,18 @@
FROM alpine:3.19.1
RUN addgroup -S nonroot \
&& adduser -S nonroot -G nonroot
USER nonroot
ARG PB_VERSION=0.21.3
RUN apk add --no-cache \
unzip \
ca-certificates
RUN addgroup -S app && adduser -S -G app app
RUN apk add --no-cache unzip ca-certificates
USER app
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/
COPY ./backend/pb_migrations /pb/pb_migrations
# COPY ./pb_hooks /pb/pb_hooks
EXPOSE 8080
# start PocketBase
CMD ["/pb/pocketbase", "serve", "--http=0.0.0.0:8080"]