mirror of
https://github.com/hanzoai/billing.git
synced 2026-10-30 18:46:54 +00:00
hanzoai/spa is the SPA-friendly server (index.html/.html fallthrough + a CSP that does not blank a client-routed app); hanzoai/static is the strict one. Consumers had drifted to two untagged pins (implicit :latest — banned, and non-reproducible) and three at 1.2.0, thirteen patches behind. One image, one version. Published spelling is 1.4.8 (v1.4.8 does not exist).
35 lines
1.5 KiB
Docker
35 lines
1.5 KiB
Docker
FROM ghcr.io/hanzoai/nodejs:v24.18.0 AS builder
|
|
RUN corepack enable && corepack prepare [email protected] --activate
|
|
WORKDIR /app
|
|
COPY package.json pnpm-lock.yaml ./
|
|
RUN pnpm install --frozen-lockfile
|
|
ARG NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID=""
|
|
ENV NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID=$NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID
|
|
|
|
# Standalone host (billing.hanzo.ai) is served at root by the SPA container,
|
|
# so build without a basePath. Override to "/admin/billing" only for the
|
|
# commerce-embedded build.
|
|
ARG NEXT_PUBLIC_BASE_PATH=""
|
|
ENV NEXT_PUBLIC_BASE_PATH=$NEXT_PUBLIC_BASE_PATH
|
|
|
|
# Square Web Payments config is baked at build time (NEXT_PUBLIC_*, static
|
|
# export). Defaults come from .env.production (live). For a SANDBOX build
|
|
# (investor demo) pass these build-args; when set, they are written to
|
|
# .env.production.local which Next.js loads at higher priority than
|
|
# .env.production — so the committed live default is never mutated and an
|
|
# unset arg leaves the live values intact.
|
|
ARG SQUARE_APPLICATION_ID=""
|
|
ARG SQUARE_LOCATION_ID=""
|
|
ARG SQUARE_ENVIRONMENT=""
|
|
|
|
COPY . .
|
|
RUN if [ -n "$SQUARE_APPLICATION_ID" ]; then \
|
|
printf 'NEXT_PUBLIC_SQUARE_APPLICATION_ID=%s\nNEXT_PUBLIC_SQUARE_LOCATION_ID=%s\nNEXT_PUBLIC_SQUARE_ENVIRONMENT=%s\n' \
|
|
"$SQUARE_APPLICATION_ID" "$SQUARE_LOCATION_ID" "$SQUARE_ENVIRONMENT" > .env.production.local; \
|
|
echo "billing: SANDBOX Square build ($SQUARE_ENVIRONMENT / $SQUARE_APPLICATION_ID)"; \
|
|
fi && \
|
|
pnpm build
|
|
|
|
FROM ghcr.io/hanzoai/spa:1.4.8
|
|
COPY --from=builder /app/out /public
|