From 2e834a286a06f99e896e8238a1d74c214bac03ac Mon Sep 17 00:00:00 2001 From: Jason Sanford Date: Mon, 1 Dec 2025 21:21:01 -0500 Subject: [PATCH] Add pb_hooks and pb_public directories to show how those directories can be automatically mounted and used at runtime. --- Dockerfile | 2 ++ pb_hooks/main.pb.js | 5 ++++ pb_public/index.html | 64 ++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 71 insertions(+) create mode 100644 pb_hooks/main.pb.js create mode 100644 pb_public/index.html diff --git a/Dockerfile b/Dockerfile index 150ac3a..174e63e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,6 +9,8 @@ RUN apk add --no-cache \ # 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/ +COPY pb_hooks /pb/pb_hooks +COPY pb_public /pb/pb_public EXPOSE 8080 diff --git a/pb_hooks/main.pb.js b/pb_hooks/main.pb.js new file mode 100644 index 0000000..e3ee84b --- /dev/null +++ b/pb_hooks/main.pb.js @@ -0,0 +1,5 @@ +routerAdd("GET", "/hello", (e) => { + let name = e.request.url.query().get("name") || "Person"; + + return e.json(200, { message: "Hello " + name }); +}); diff --git a/pb_public/index.html b/pb_public/index.html new file mode 100644 index 0000000..cde04a5 --- /dev/null +++ b/pb_public/index.html @@ -0,0 +1,64 @@ + + + + + + Hello World - PocketBase + + + +
+

Hello World!

+

PocketBase is successfully serving this page.

+
✓ Server is running
+
+ + +