ac29735d20
The contract requires the application to serve a wallet file and hand its URL and password to the data layer. Until now the only source was a filesystem path, which no container has: `*.ngw` is gitignored, `COPY . .` brings none, and nothing mounts one -- so a deployed instance served 404 where the contract expects bytes. `FESTIPOD_SHARED_WALLET_FILE_BASE64` carries the file itself. It is 810 bytes, and it is not a secret: by design the application hands it to every user who opens the app, so provisioning persistent storage would be guarding something public. One channel for both values, nothing to mount, and a new host needs only its variables. Precedence is deliberate and one-directional: the path always wins when set, and an unreadable path does NOT fall through to the base64 form. A deployment sets exactly one; both set is a leftover, not a fallback chain. Local development and the test harness only ever set the path, so they are untouched. A malformed value answers 500 and names the variable. Answering 404 would have made "configured wrong" indistinguishable from "not configured at all" -- the confusion this codebase has spent two days removing. Proven by serving the same wallet from each source in turn and comparing: identical size, identical sha256. The first attempt at that proof silently exercised the path branch, because Bun auto-loads `.env` and the variable was already there; the checksums matched for the wrong reason. Caught, cleared, and measured again.
28 lines
1008 B
Docker
28 lines
1008 B
Docker
# Use the official Bun image (runtime stays Bun; only install moves to pnpm)
|
|
FROM oven/bun:1-alpine AS base
|
|
WORKDIR /app
|
|
|
|
# Install dependencies with pnpm.
|
|
# - git: @ng-eventually/polyfill is a git+https (public Gitea) dependency → no auth.
|
|
# - nodejs + npm: pnpm is a Node CLI; we pin the exact pnpm version via `npm i -g`
|
|
# (Alpine's nodejs package does not bundle corepack).
|
|
# The `bun` npm peer (pulled by bun-plugin-tailwind) is approved to build in package.json
|
|
# (pnpm.onlyBuiltDependencies) so node_modules/.bin/bun is a real binary — required because
|
|
# `bun run start` puts node_modules/.bin ahead of PATH.
|
|
FROM base AS install
|
|
RUN apk add --no-cache git nodejs npm \
|
|
&& npm install -g pnpm@10.26.0
|
|
COPY package.json pnpm-lock.yaml ./
|
|
RUN pnpm install --frozen-lockfile
|
|
|
|
# Copy source code and build assets
|
|
FROM base AS release
|
|
COPY --from=install /app/node_modules node_modules
|
|
COPY . .
|
|
|
|
# Run the app
|
|
ENV NODE_ENV=production
|
|
USER bun
|
|
EXPOSE 3000/tcp
|
|
ENTRYPOINT [ "bun", "run", "start" ]
|