start
This commit is contained in:
30
commands/04-start-pocketbase.sh
Executable file
30
commands/04-start-pocketbase.sh
Executable file
@@ -0,0 +1,30 @@
|
||||
#! /bin/bash
|
||||
source .env
|
||||
|
||||
pb_ap=${STORAGE_VOLUME}/${POCKETBASE_NAME}
|
||||
|
||||
for p in "${pb_ap}/data ${pb_ap}/public"; do
|
||||
if ! ls ${p} >/dev/null 2>&1; then
|
||||
echo "Creating ${p} directory..."
|
||||
mkdir -p ${p}
|
||||
else
|
||||
echo "directory exists ${p}"
|
||||
fi
|
||||
done
|
||||
|
||||
podman run -d --replace \
|
||||
--name ${POCKETBASE_NAME} \
|
||||
--hostname ${POCKETBASE_NAME} \
|
||||
--restart=always \
|
||||
--network container-bridge \
|
||||
-p ${POCKETBASE_PORT}:${POCKETBASE_PORT} \
|
||||
-e PB_PORT=${POCKETBASE_PORT} \
|
||||
-e PB_ADMIN_EMAIL=${ADMIN_EMAIL} \
|
||||
-e PB_ADMIN_PASSWORD=${ADMIN_PASSWORD} \
|
||||
-v ${pb_ap}/data:/pb_data \
|
||||
-v ${pb_ap}/public:/public \
|
||||
--health-cmd="wget --no-verbose --tries=1 --spider ${LOCAL_IP}:${POCKETBASE_PORT}/api/health" \
|
||||
--health-interval=30s \
|
||||
--health-timeout=10s \
|
||||
--health-retries=5 \
|
||||
ghcr.io/muchobien/pocketbase:latest
|
||||
Reference in New Issue
Block a user