The minimalistic document archiving platform.
chore(docker): cleanup prod dockerfile (#753)
Corentin Thomassetff5519564e41
diff --git a/apps/papra-server/Dockerfile b/apps/papra-server/Dockerfileindex 816645bd..da03ba26 100644--- a/apps/papra-server/Dockerfile+++ b/apps/papra-server/Dockerfile@@ -1,62 +1,45 @@# syntax = docker/dockerfile:1-# Adjust NODE_VERSION as desiredARG NODE_VERSION=24.11.0FROM node:${NODE_VERSION}-slim AS baseLABEL fly_launch_runtime="Node.js"-# Install pnpmARG PNPM_VERSION=10.19.0RUN npm install -g pnpm@${PNPM_VERSION}-# Node.js app lives hereWORKDIR /app-# Set production environmentENV NODE_ENV="production"+# ------------------# Throw-away build stage to reduce size of final imageFROM base AS build-# Install packages needed to build node modules+# Install packages needed by some node modulesRUN apt-get update -qq && \apt-get install --no-install-recommends -y build-essential node-gyp pkg-config python-is-python3-# Copy monorepo configuration filesCOPY pnpm-workspace.yaml package.json pnpm-lock.yaml ./-# Copy package.json files for all workspace packagesCOPY packages/lecture/package.json ./packages/lecture/package.jsonCOPY packages/webhooks/package.json ./packages/webhooks/package.jsonCOPY packages/search-parser/package.json ./packages/search-parser/package.jsonCOPY apps/papra-server/package.json ./apps/papra-server/package.json-# Install all dependencies (workspace-aware)-RUN pnpm install --frozen-lockfile+RUN pnpm install --frozen-lockfile --ignore-scripts-# Copy source code for dependenciesCOPY packages/lecture ./packages/lectureCOPY packages/webhooks ./packages/webhooksCOPY packages/search-parser ./packages/search-parser--# Build workspace dependencies-RUN pnpm --filter @papra/lecture build-RUN pnpm --filter @papra/webhooks build-RUN pnpm --filter @papra/search-parser build--# Copy server application codeCOPY apps/papra-server ./apps/papra-server-# Build server application-RUN pnpm --filter @papra/app-server build+RUN pnpm --filter "@papra/app-server..." run build-# Prune dev dependenciesRUN pnpm --filter @papra/app-server --prod --legacy deploy /app/production+# ------------------# Final stage for app imageFROM baseENV NODE_ENV="production"ENV PORT=1221@@ -66,9 +49,9 @@ RUN apt-get update -qq && \apt-get install --no-install-recommends -y tesseract-ocr tesseract-ocr-all && \rm -rf /var/lib/apt/lists/*-# Copy built application from production deploymentCOPY --from=build /app/production /app-# Start the server by default, this can be overwritten at runtimeEXPOSE 1221++# The command is overridden by Fly at runtime, see ./fly.tomlCMD [ "pnpm", "--silent", "start:with-migrations" ]