logicsrc/.nixpacks/Dockerfile
Anthony Ettinger 297c5df54a
chore(deps): upgrade all dependencies; next 16.4.3 (RCE GHSA-2464-fhr4-w9xw) (#257)
- next 16.3.8 -> 16.4.3 (GHSA-2464-fhr4-w9xw, GHSA-673q-mjm6-r5xr)
- every workspace dependency to latest; majors: express 5, @simplewebauthn 14,
  imapflow 2 (status() may return false), nodemailer 10, libsodium-wrappers 0.8,
  commander 15, vite 8, @vitejs/plugin-react 6, typescript 7 (base tsconfig
  lists types: ["node"]), @logicsrc/validators 0.6, openmcp 0.4, hqtui 0.11,
  stack 0.5, x402-gateway 0.13
- bun 1.4.4 (image + packageManager)
- bun audit: 3 critical / 34 high -> 0

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-26 07:06:46 -07:00

48 lines
2.1 KiB
Docker

# syntax=docker/dockerfile:1
#
# logicsrc.com and app.logicsrc.com, run on Bun. One image serves both sites.
#
# This file lives at .nixpacks/Dockerfile because that is the path dev2's compose
# stacks build (cli-tools dev2/dev2-site provision records it per site, and
# re-provisioning keeps it). It used to be nixpacks output (Node + npm); it is now
# a hand-written Bun image, so do not regenerate it with nixpacks.
#
# Contract with dev2, unchanged from the Node image:
# - Listens on 3000 inside the container and answers / for the deploy health check.
# - ENTRYPOINT is `bash -l -c`, so a compose `command:` is ONE string, as before.
# logicsrc.com uses the default CMD; app.logicsrc.com's compose overrides it
# with "npm --workspace @logicsrc/pwa run start", which .nixpacks/npm (the
# image's `npm`) turns into `bun run start` in apps/pwa.
# - Takes the PUBLIC_URL build arg; secrets come from app.env at run time.
#
# The whole workspace tree ships, not a Next standalone bundle: app.logicsrc.com
# runs apps/pwa (Express) from the same image, with its own dependencies.
#
# Bun 1.4.2, not the fleet's usual 1.4.0: 1.4.0 re-resolves this workspace's
# `file:` cross-references differently on every install, so its own lockfile
# never passes --frozen-lockfile. 1.4.2 is stable on it.
FROM oven/bun:1.4.4-slim AS build
WORKDIR /app
ARG PUBLIC_URL
ENV PUBLIC_URL=$PUBLIC_URL \
NEXT_TELEMETRY_DISABLED=1
COPY . .
RUN bun install --frozen-lockfile
# Every workspace build (tsc, vite, `bun --bun next build`), in dependency order.
RUN bun run build
FROM oven/bun:1.4.4-slim AS runtime
WORKDIR /app
ENV NODE_ENV=production \
NEXT_TELEMETRY_DISABLED=1 \
PORT=3000
COPY --from=build --chown=bun:bun /app /app
COPY --chown=root:root .nixpacks/npm /usr/local/bin/npm
# The oven/bun image ships a non-root `bun` user.
USER bun
EXPOSE 3000
ENTRYPOINT ["/bin/bash", "-l", "-c"]
# logicsrc.com: Next's own entry file run directly by Bun, one process, no
# wrapper (`bun run start` would leave three bun processes stacked up).
CMD ["cd apps/logicsrc-web && exec bun --bun /app/node_modules/next/dist/bin/next start"]