Change default PocketBase port to 8070
Set the default listen/host port to 8070 across both the rootless and root stacks (previously 8080 rootless / 8081 root). Both internal and external mappings derive from the same PB_PORT/PB_PORT_ROOT variables, so a single change covers container and host. Updated .env.example, both Dockerfiles (ENV/EXPOSE), both compose files (env, port mapping, healthcheck), and both entrypoint fallbacks. Note: both stacks now default to host port 8070, so they can no longer run simultaneously without overriding PB_PORT_ROOT. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
e11acb8165
commit
9c49a1f544
+2
-2
@@ -10,10 +10,10 @@ PB_VERSION=0.39.7
|
|||||||
CONTAINER_NAME=pocketbase
|
CONTAINER_NAME=pocketbase
|
||||||
|
|
||||||
# Port PocketBase listens on (used both inside the container and for the host mapping)
|
# Port PocketBase listens on (used both inside the container and for the host mapping)
|
||||||
PB_PORT=8080
|
PB_PORT=8070
|
||||||
|
|
||||||
# Port for the root variant (only used with `docker compose --profile root up`)
|
# Port for the root variant (only used with `docker compose --profile root up`)
|
||||||
PB_PORT_ROOT=8081
|
PB_PORT_ROOT=8070
|
||||||
|
|
||||||
# ── Superuser bootstrap ───────────────────────────────────────────────
|
# ── Superuser bootstrap ───────────────────────────────────────────────
|
||||||
# On every start the entrypoint checks whether PB_ADMIN_EMAIL already exists:
|
# On every start the entrypoint checks whether PB_ADMIN_EMAIL already exists:
|
||||||
|
|||||||
+2
-2
@@ -41,8 +41,8 @@ COPY --chmod=0755 entrypoint.root.sh /pb/entrypoint.root.sh
|
|||||||
VOLUME /pb/pb_data
|
VOLUME /pb/pb_data
|
||||||
|
|
||||||
# default listen port; override at runtime with -e PB_PORT=...
|
# default listen port; override at runtime with -e PB_PORT=...
|
||||||
ENV PB_PORT=8080
|
ENV PB_PORT=8070
|
||||||
EXPOSE 8080
|
EXPOSE 8070
|
||||||
|
|
||||||
# shell form so ${PB_PORT} is expanded from the runtime environment
|
# shell form so ${PB_PORT} is expanded from the runtime environment
|
||||||
HEALTHCHECK --interval=30s --timeout=5s --start-period=5s --retries=3 \
|
HEALTHCHECK --interval=30s --timeout=5s --start-period=5s --retries=3 \
|
||||||
|
|||||||
+2
-2
@@ -45,8 +45,8 @@ VOLUME /pb/pb_data
|
|||||||
USER pb
|
USER pb
|
||||||
|
|
||||||
# default listen port; override at runtime with -e PB_PORT=...
|
# default listen port; override at runtime with -e PB_PORT=...
|
||||||
ENV PB_PORT=8080
|
ENV PB_PORT=8070
|
||||||
EXPOSE 8080
|
EXPOSE 8070
|
||||||
|
|
||||||
# shell form so ${PB_PORT} is expanded from the runtime environment
|
# shell form so ${PB_PORT} is expanded from the runtime environment
|
||||||
HEALTHCHECK --interval=30s --timeout=5s --start-period=5s --retries=3 \
|
HEALTHCHECK --interval=30s --timeout=5s --start-period=5s --retries=3 \
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ services:
|
|||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
environment:
|
environment:
|
||||||
# server
|
# server
|
||||||
PB_PORT: ${PB_PORT_ROOT:-8081}
|
PB_PORT: ${PB_PORT_ROOT:-8070}
|
||||||
# superuser bootstrap (checked/created by the entrypoint on every start)
|
# superuser bootstrap (checked/created by the entrypoint on every start)
|
||||||
PB_ADMIN_EMAIL: ${PB_ADMIN_EMAIL:-}
|
PB_ADMIN_EMAIL: ${PB_ADMIN_EMAIL:-}
|
||||||
PB_ADMIN_PASSWORD: ${PB_ADMIN_PASSWORD:-}
|
PB_ADMIN_PASSWORD: ${PB_ADMIN_PASSWORD:-}
|
||||||
@@ -24,7 +24,7 @@ services:
|
|||||||
PB_ENCRYPTION_KEY: ${PB_ENCRYPTION_KEY:-}
|
PB_ENCRYPTION_KEY: ${PB_ENCRYPTION_KEY:-}
|
||||||
ports:
|
ports:
|
||||||
# host:container
|
# host:container
|
||||||
- "${PB_PORT_ROOT:-8081}:${PB_PORT_ROOT:-8081}"
|
- "${PB_PORT_ROOT:-8070}:${PB_PORT_ROOT:-8070}"
|
||||||
volumes:
|
volumes:
|
||||||
# persist the SQLite database and uploaded files
|
# persist the SQLite database and uploaded files
|
||||||
- pb_data:/pb/pb_data
|
- pb_data:/pb/pb_data
|
||||||
@@ -32,7 +32,7 @@ services:
|
|||||||
# - ./pb_migrations:/pb/pb_migrations
|
# - ./pb_migrations:/pb/pb_migrations
|
||||||
# - ./pb_hooks:/pb/pb_hooks
|
# - ./pb_hooks:/pb/pb_hooks
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: ["CMD-SHELL", "wget -qO- http://127.0.0.1:${PB_PORT_ROOT:-8081}/api/health || exit 1"]
|
test: ["CMD-SHELL", "wget -qO- http://127.0.0.1:${PB_PORT_ROOT:-8070}/api/health || exit 1"]
|
||||||
interval: 30s
|
interval: 30s
|
||||||
timeout: 5s
|
timeout: 5s
|
||||||
start_period: 5s
|
start_period: 5s
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ services:
|
|||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
environment:
|
environment:
|
||||||
# server
|
# server
|
||||||
PB_PORT: ${PB_PORT:-8080}
|
PB_PORT: ${PB_PORT:-8070}
|
||||||
# superuser bootstrap (checked/created by the entrypoint on every start)
|
# superuser bootstrap (checked/created by the entrypoint on every start)
|
||||||
PB_ADMIN_EMAIL: ${PB_ADMIN_EMAIL:-}
|
PB_ADMIN_EMAIL: ${PB_ADMIN_EMAIL:-}
|
||||||
PB_ADMIN_PASSWORD: ${PB_ADMIN_PASSWORD:-}
|
PB_ADMIN_PASSWORD: ${PB_ADMIN_PASSWORD:-}
|
||||||
@@ -24,7 +24,7 @@ services:
|
|||||||
PB_ENCRYPTION_KEY: ${PB_ENCRYPTION_KEY:-}
|
PB_ENCRYPTION_KEY: ${PB_ENCRYPTION_KEY:-}
|
||||||
ports:
|
ports:
|
||||||
# host:container
|
# host:container
|
||||||
- "${PB_PORT:-8080}:${PB_PORT:-8080}"
|
- "${PB_PORT:-8070}:${PB_PORT:-8070}"
|
||||||
volumes:
|
volumes:
|
||||||
# persist the SQLite database and uploaded files
|
# persist the SQLite database and uploaded files
|
||||||
- pb_data:/pb/pb_data
|
- pb_data:/pb/pb_data
|
||||||
@@ -32,7 +32,7 @@ services:
|
|||||||
# - ./pb_migrations:/pb/pb_migrations
|
# - ./pb_migrations:/pb/pb_migrations
|
||||||
# - ./pb_hooks:/pb/pb_hooks
|
# - ./pb_hooks:/pb/pb_hooks
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: ["CMD-SHELL", "wget -qO- http://127.0.0.1:${PB_PORT:-8080}/api/health || exit 1"]
|
test: ["CMD-SHELL", "wget -qO- http://127.0.0.1:${PB_PORT:-8070}/api/health || exit 1"]
|
||||||
interval: 30s
|
interval: 30s
|
||||||
timeout: 5s
|
timeout: 5s
|
||||||
start_period: 5s
|
start_period: 5s
|
||||||
|
|||||||
+1
-1
@@ -6,7 +6,7 @@ set -e
|
|||||||
|
|
||||||
DATA_DIR="/pb/pb_data"
|
DATA_DIR="/pb/pb_data"
|
||||||
DB_FILE="${DATA_DIR}/data.db"
|
DB_FILE="${DATA_DIR}/data.db"
|
||||||
PB_PORT="${PB_PORT:-8080}"
|
PB_PORT="${PB_PORT:-8070}"
|
||||||
|
|
||||||
# ---- assemble global flags shared by every pocketbase invocation ----
|
# ---- assemble global flags shared by every pocketbase invocation ----
|
||||||
set -- --dir="${DATA_DIR}"
|
set -- --dir="${DATA_DIR}"
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ set -e
|
|||||||
|
|
||||||
DATA_DIR="/pb/pb_data"
|
DATA_DIR="/pb/pb_data"
|
||||||
DB_FILE="${DATA_DIR}/data.db"
|
DB_FILE="${DATA_DIR}/data.db"
|
||||||
PB_PORT="${PB_PORT:-8080}"
|
PB_PORT="${PB_PORT:-8070}"
|
||||||
|
|
||||||
# ---- assemble global flags shared by every pocketbase invocation ----
|
# ---- assemble global flags shared by every pocketbase invocation ----
|
||||||
set -- --dir="${DATA_DIR}"
|
set -- --dir="${DATA_DIR}"
|
||||||
|
|||||||
Reference in New Issue
Block a user