From 1e84db4eccd39aceb5f80c5ee90bd0386cde9f47 Mon Sep 17 00:00:00 2001 From: Tola Leng Date: Wed, 2 Jul 2025 20:03:06 +0700 Subject: [PATCH] Add new entrypoint for container startup script with hidden pocketbase admin (UI) --- scripts/entrypoint_hide-admin.sh | 36 ++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 scripts/entrypoint_hide-admin.sh diff --git a/scripts/entrypoint_hide-admin.sh b/scripts/entrypoint_hide-admin.sh new file mode 100644 index 0000000..e2f4f32 --- /dev/null +++ b/scripts/entrypoint_hide-admin.sh @@ -0,0 +1,36 @@ +#!/bin/sh + +echo "Running on architecture: $(uname -m)" + +# Copy PocketBase data if empty +if [ ! -f /mnt/pb_data/data.db ] && [ -d /app/pb_data ] && [ "$(ls -A /app/pb_data)" ]; then + cp -a /app/pb_data/. /mnt/pb_data/ +fi + +# Start PocketBase in the background with no admin UI and filtered logs +echo "Starting CheckCle Application..." +( + /app/pocketbase serve \ + --http=0.0.0.0:8090 \ + --dir /mnt/pb_data \ + --no-admin \ + 2>&1 | grep -vE 'REST API|Dashboard' +) & + +# Wait for PocketBase to become available +echo "Waiting for Backend Server to become available..." +until curl -s http://localhost:8090/api/health >/dev/null; do + echo "Waiting on http://localhost:8090..." + sleep 1 +done + +echo "Backend Server is up!" + +# Start Go service +echo "Starting Go Operational service..." +/app/service-operation & + +echo "Default Access: admin@example.com/Admin123456" + +# Keep container alive +wait