update pocketbase,
This commit is contained in:
30
002_source/pocketbase/docker/dockerfile
Normal file
30
002_source/pocketbase/docker/dockerfile
Normal file
@@ -0,0 +1,30 @@
|
||||
FROM alpine:3 as downloader
|
||||
|
||||
ARG TARGETOS
|
||||
ARG TARGETARCH
|
||||
ARG TARGETVARIANT
|
||||
ARG VERSION
|
||||
|
||||
ENV BUILDX_ARCH="${TARGETOS:-linux}_${TARGETARCH:-amd64}${TARGETVARIANT}"
|
||||
|
||||
RUN wget https://github.com/pocketbase/pocketbase/releases/download/v${VERSION}/pocketbase_${VERSION}_${BUILDX_ARCH}.zip \
|
||||
&& unzip pocketbase_${VERSION}_${BUILDX_ARCH}.zip \
|
||||
&& chmod +x /pocketbase
|
||||
|
||||
FROM alpine:3
|
||||
RUN apk update && apk add ca-certificates && rm -rf /var/cache/apk/*
|
||||
|
||||
EXPOSE 8090
|
||||
|
||||
COPY --from=downloader /pocketbase /usr/local/bin/pocketbase
|
||||
|
||||
# ---
|
||||
RUN apk add sqlite entr
|
||||
|
||||
COPY entrypoint.sh /entrypoint.sh
|
||||
# ENTRYPOINT ["/entrypoint.sh"]
|
||||
|
||||
RUN apk add nodejs yarn
|
||||
RUN yarn global add nodemon
|
||||
|
||||
ENTRYPOINT ["/usr/local/bin/pocketbase", "serve", "--http=0.0.0.0:8090", "--dir=/pb_data", "--publicDir=/pb_public", "--hooksDir=/pb_hooks"]
|
28
002_source/pocketbase/docker/entrypoint.sh
Executable file
28
002_source/pocketbase/docker/entrypoint.sh
Executable file
@@ -0,0 +1,28 @@
|
||||
#!/usr/bin/env sh
|
||||
|
||||
set -ex
|
||||
|
||||
sleep 1
|
||||
|
||||
# original from dockerfile
|
||||
|
||||
echo "init first migration for create user"
|
||||
/usr/local/bin/pocketbase migrate up
|
||||
|
||||
echo "create admin account"
|
||||
# /usr/local/bin/pocketbase superuser upsert admin@123.com Aa12345678
|
||||
/usr/local/bin/pocketbase migrate up --dir=/pb_data --migrationsDir=/pb_migrations
|
||||
|
||||
|
||||
echo "start server"
|
||||
/usr/local/bin/pocketbase serve \
|
||||
--http=0.0.0.0:8090 \
|
||||
--dir=/pb_data \
|
||||
--migrationsDir=/pb_migrations \
|
||||
--publicDir=/pb_public \
|
||||
--hooksDir=/pb_hooks &
|
||||
|
||||
sleep 5
|
||||
echo "calling hook"
|
||||
|
||||
/usr/local/bin/pocketbase hello
|
Reference in New Issue
Block a user