FROM node:20-slim as builder WORKDIR /app COPY web ./ RUN npm install -g pnpm RUN pnpm install RUN pnpm build FROM alpine:latest ARG PB_VERSION=0.21.1 RUN apk add --no-cache unzip ca-certificates tzdata && \ ln -fs /usr/share/zoneinfo/Asia/Shanghai /etc/localtime # 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/ RUN mkdir -p /pb COPY ./pb/pb_migrations /pb/pb_migrations COPY ./pb/pb_hooks /pb/pb_hooks COPY --from=builder /app/dist /pb/pb_public WORKDIR /pb EXPOSE 8090 CMD tail -f /dev/null # CMD ["/pb/pocketbase", "serve", "--http=0.0.0.0:8090"]