This commit is contained in:
2026-09-02 17:51:31 +00:00
parent c078745bc0
commit b1f5b83b1d
2 changed files with 25 additions and 92 deletions
+14 -14
View File
@@ -3,17 +3,17 @@
# ------------------------------------------------------------------------------
# Stage 1: Install frontend dependencies (Native execution on host architecture)
# ------------------------------------------------------------------------------
FROM --platform=$BUILDPLATFORM node:22-bookworm-slim AS deps
FROM --platform=$BUILDPLATFORM node:lts-trixie-slim AS deps
WORKDIR /app/frontend
COPY frontend/package.json frontend/package-lock.json* ./
RUN --mount=type=cache,target=/root/.npm \
npm ci
npm ci
# ------------------------------------------------------------------------------
# Stage 2: Build the TanStack Start frontend (Native execution on host architecture)
# ------------------------------------------------------------------------------
FROM --platform=$BUILDPLATFORM node:22-bookworm-slim AS builder
FROM --platform=$BUILDPLATFORM node:lts-trixie-slim AS builder
WORKDIR /app/frontend
COPY --from=deps /app/frontend/node_modules ./node_modules
@@ -31,11 +31,11 @@ ARG PB_VERSION=0.40.2
RUN apk add --no-cache curl unzip ca-certificates \
&& case "${TARGETARCH}" in \
amd64) PB_ARCH="amd64" ;; \
arm64) PB_ARCH="arm64" ;; \
arm) PB_ARCH="armv7" ;; \
*) echo "Unsupported target architecture: ${TARGETARCH}" >&2; exit 1 ;; \
esac \
amd64) PB_ARCH="amd64" ;; \
arm64) PB_ARCH="arm64" ;; \
arm) PB_ARCH="armv7" ;; \
*) echo "Unsupported target architecture: ${TARGETARCH}" >&2; exit 1 ;; \
esac \
&& curl -fsSL -o /tmp/pb.zip "https://github.com/pocketbase/pocketbase/releases/download/v${PB_VERSION}/pocketbase_${PB_VERSION}_linux_${PB_ARCH}.zip" \
&& unzip /tmp/pb.zip -d /app \
&& chmod +x /app/pocketbase \
@@ -44,12 +44,12 @@ RUN apk add --no-cache curl unzip ca-certificates \
# ------------------------------------------------------------------------------
# Stage 4: Production runner (Target architecture)
# ------------------------------------------------------------------------------
FROM node:22-bookworm-slim AS runner
FROM node:lts-trixie-slim AS runner
LABEL maintainer="Amritanshu <docker@tanshu.com>"
RUN apt-get update && apt-get install -y --no-install-recommends \
curl \
ca-certificates \
curl \
ca-certificates \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
@@ -67,9 +67,9 @@ RUN chmod +x /app/docker-entrypoint.sh
# Environment variables
ENV NODE_ENV=production \
PORT=3000 \
HOST=0.0.0.0 \
PB_DATA_DIR=/app/pb_data
PORT=3000 \
HOST=0.0.0.0 \
PB_DATA_DIR=/app/pb_data
# Persistent data volume for PocketBase SQLite database and file storage
VOLUME ["/app/pb_data"]