-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.pocketbase
More file actions
42 lines (34 loc) · 1.64 KB
/
Copy pathDockerfile.pocketbase
File metadata and controls
42 lines (34 loc) · 1.64 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# ─────────────────────────────────────────────
# PocketBase backend
# Runs as a standalone binary — no build step needed.
# ─────────────────────────────────────────────
FROM alpine:3.19
# Install ca-certificates so PocketBase can make HTTPS calls,
# and unzip for extracting the release archive.
RUN apk add --no-cache \
ca-certificates \
unzip \
wget
# PocketBase version — update this to the latest release as needed.
# Check: https://github.com/pocketbase/pocketbase/releases
ARG PB_VERSION=0.22.14
# Download the correct binary for the container's architecture.
# Railway runs on linux/amd64; the ARG lets you override for arm64 if needed.
ARG PB_ARCH=linux_amd64
RUN wget -q \
"https://github.com/pocketbase/pocketbase/releases/download/v${PB_VERSION}/pocketbase_${PB_VERSION}_${PB_ARCH}.zip" \
-O /tmp/pocketbase.zip && \
unzip /tmp/pocketbase.zip -d /pb/ && \
rm /tmp/pocketbase.zip && \
chmod +x /pb/pocketbase
# pb_data is where PocketBase stores its SQLite database, uploaded files,
# and logs. This directory MUST be mounted to a persistent volume in Railway
# (Settings → Volumes → Mount Path: /pb/pb_data) otherwise all data is
# lost every time the container restarts.
# VOLUME /pb/pb_data
WORKDIR /pb
# Railway assigns a dynamic port via $PORT.
# PocketBase's --http flag binds to that port.
# Default to 8090 for local Docker testing.
EXPOSE 8090
CMD ["sh", "-c", "./pocketbase serve --http=0.0.0.0:${PORT:-8090} --dir=/pb/pb_data"]