Assemble QMS app + SQLite refactor + Unraid single-container deploy
Build and Push Docker Image / build (push) Successful in 1m12s
Build and Push Docker Image / build (push) Successful in 1m12s
Reconstruct the full app from init-source overlays (base + fix-1..6 + update-1..3, last-wins) at the repo root, complete the missing pieces so it builds and runs, and stage the Unraid deployment. App completion: - types/index.ts: former Prisma enums as string-literal unions + AppUser - pages/_app.tsx + styles/globals.css (mount AppProvider/ToastProvider) - API routes: auth/login, auth/me, users, submissions (+REVIEW_READY notify), forms (list/create), notifications - scripts/create-admin.js: idempotent first-admin bootstrap - 14 unbuilt nav targets stubbed via ComingSoon placeholder SQLite refactor (single-container, no external DB): - schema provider -> sqlite; enums -> String; Json -> String; FormField.options String[] -> JSON-encoded String - lib/forms.ts (de)serialises options at the DB boundary - drop mode:"insensitive" (unsupported on SQLite) - enum imports repointed from @prisma/client to @/types Deploy: - multi-stage Dockerfile (next build -> prod runner), docker-entrypoint.sh (prisma db push -> create-admin -> next start), .dockerignore - docker-compose.yml: br0 10.2.0.x, /mnt/user/appdata/qms -> /data volume - README rewritten for the Unraid/Gitea Actions flow; .env scrubbed of the live Supabase credential; vercel.json removed Verified: next build clean (41 routes); live SQLite round-trip of login/session, form options array, and submission -> REVIEW_READY. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
+43
@@ -0,0 +1,43 @@
|
||||
# syntax=docker/dockerfile:1
|
||||
# V11 Enterprise QMS — single-container image (Next.js + Prisma + SQLite)
|
||||
|
||||
# ─── Builder ──────────────────────────────────────────────────────────────────
|
||||
FROM node:20-alpine AS builder
|
||||
WORKDIR /app
|
||||
|
||||
# Install deps (legacy-peer-deps comes from .npmrc — needed for React 19)
|
||||
COPY package.json package-lock.json .npmrc ./
|
||||
RUN npm ci
|
||||
|
||||
# Build (prisma generate && next build). DATABASE_URL is only needed at runtime;
|
||||
# a dummy value satisfies prisma generate during the image build.
|
||||
COPY . .
|
||||
ENV DATABASE_URL="file:/data/qms.db"
|
||||
RUN npm run build
|
||||
|
||||
# ─── Runner ───────────────────────────────────────────────────────────────────
|
||||
FROM node:20-alpine AS runner
|
||||
WORKDIR /app
|
||||
ENV NODE_ENV=production
|
||||
ENV PORT=3000
|
||||
ENV DATABASE_URL="file:/data/qms.db"
|
||||
|
||||
# Production deps only (keeps next + prisma CLI + @prisma/client; drops build tooling)
|
||||
COPY package.json package-lock.json .npmrc ./
|
||||
RUN npm ci --omit=dev
|
||||
|
||||
# Prisma schema + generated client for the prod node_modules
|
||||
COPY prisma ./prisma
|
||||
RUN npx prisma generate
|
||||
|
||||
# App build output and runtime files
|
||||
COPY --from=builder /app/.next ./.next
|
||||
COPY next.config.js ./
|
||||
COPY scripts ./scripts
|
||||
COPY docker-entrypoint.sh ./
|
||||
|
||||
# /data holds the SQLite file and is mounted from the Unraid host
|
||||
RUN mkdir -p /data && chmod +x docker-entrypoint.sh
|
||||
|
||||
EXPOSE 3000
|
||||
ENTRYPOINT ["./docker-entrypoint.sh"]
|
||||
Reference in New Issue
Block a user