This commit is contained in:
2026-03-14 15:02:17 -05:00
parent ee2a114932
commit a7b312efa9
2 changed files with 17 additions and 3 deletions

View File

@@ -1,5 +1,8 @@
FROM node:22-bookworm-slim AS base ARG NODE_VERSION=22
FROM node:${NODE_VERSION}-bookworm-slim AS base
WORKDIR /app WORKDIR /app
ENV PUPPETEER_SKIP_DOWNLOAD=true
FROM base AS deps FROM base AS deps
COPY package.json package-lock.json ./ COPY package.json package-lock.json ./
@@ -13,7 +16,7 @@ COPY . .
RUN npm run prisma:generate RUN npm run prisma:generate
RUN npm run build RUN npm run build
FROM node:22-bookworm-slim AS runtime FROM node:${NODE_VERSION}-bookworm-slim AS runtime
WORKDIR /app WORKDIR /app
ENV NODE_ENV=production ENV NODE_ENV=production
@@ -21,6 +24,7 @@ ENV PORT=3000
ENV DATA_DIR=/app/data ENV DATA_DIR=/app/data
ENV DATABASE_URL=file:../../data/prisma/app.db ENV DATABASE_URL=file:../../data/prisma/app.db
ENV PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium ENV PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium
ENV PUPPETEER_SKIP_DOWNLOAD=true
RUN apt-get update && apt-get install -y --no-install-recommends \ RUN apt-get update && apt-get install -y --no-install-recommends \
chromium \ chromium \
@@ -71,7 +75,7 @@ COPY --from=build /app/server/dist /app/server/dist
COPY --from=build /app/shared/dist /app/shared/dist COPY --from=build /app/shared/dist /app/shared/dist
COPY --from=build /app/server/prisma /app/server/prisma COPY --from=build /app/server/prisma /app/server/prisma
COPY --from=build /app/docker-entrypoint.sh /app/docker-entrypoint.sh COPY --from=build /app/docker-entrypoint.sh /app/docker-entrypoint.sh
COPY README.md INSTRUCTIONS.md STRUCTURE.md ./ COPY README.md INSTRUCTIONS.md STRUCTURE.md ROADMAP.md UNRAID.md ./
RUN chmod +x /app/docker-entrypoint.sh RUN chmod +x /app/docker-entrypoint.sh

View File

@@ -33,6 +33,16 @@ docker build -t mrp-codex .
docker run -p 3000:3000 -v mrp_data:/app/data mrp-codex docker run -p 3000:3000 -v mrp_data:/app/data mrp-codex
``` ```
Command-line build notes:
- The Dockerfile is intended to be built directly from the repo root with `docker build`
- `puppeteer` browser download is disabled during image build because the runtime image installs system Chromium
- You can override the Node base image version if needed:
```bash
docker build --build-arg NODE_VERSION=22 -t mrp-codex .
```
The container startup script runs `npx prisma migrate deploy` automatically before launching the server. The container startup script runs `npx prisma migrate deploy` automatically before launching the server.
## Persistence and backup ## Persistence and backup