Skip to content

Conversation

atharvf14t
Copy link

@atharvf14t atharvf14t commented Oct 7, 2025

Summary

Added a Dockerfile to enable containerized deployment for Papermark.

Details

  • Based on Node 18 Alpine
  • Multi-stage build for smaller image
  • Runs prisma generate and npm run build
  • Runs prisma migrate deploy on container start
  • Supports external PostgreSQL and blob storage

Testing

Summary by CodeRabbit

  • Chores
    • Added Docker optimizations for smaller images and faster, more reliable builds.
    • Excluded unnecessary files from build context to speed up deployments.
    • Standardized production runtime settings and port exposure.
    • Automated database migrations on container start for smoother releases.

@atharvf14t atharvf14t requested a review from mfts as a code owner October 7, 2025 11:02
Copy link

vercel bot commented Oct 7, 2025

@atharvf14t is attempting to deploy a commit to the mftsio Team on Vercel.

A member of the Team first needs to authorize it.

Copy link

github-actions bot commented Oct 7, 2025

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

Copy link
Contributor

coderabbitai bot commented Oct 7, 2025

Walkthrough

Adds Docker-related configuration: a new .dockerignore with common exclusions and a multi-stage Node.js 18 Alpine Dockerfile that installs dependencies, builds the app, runs Prisma generate, prepares production artifacts, exposes port 3000, and starts with Prisma migrate deploy followed by npm start.

Changes

Cohort / File(s) Summary of Changes
Docker configuration
Dockerfile, .dockerignore
.dockerignore: Adds exclusions for node_modules, npm-debug.log, .env, .git, .gitignore, Dockerfile, docker-compose.yml, .vscode to reduce build context. Dockerfile: Multi-stage (deps/builder/runner) for Node.js 18 Alpine; installs OpenSSL; runs npm ci, Prisma generate, Next.js build; copies build artifacts; sets NODE_ENV=production, PORT=3000; runs prisma migrate deploy then npm start; exposes port 3000.

Pre-merge checks

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title clearly and concisely summarizes the main change by indicating that a Dockerfile has been added to containerize Papermark, which directly reflects the content and objectives of the pull request. It avoids unnecessary detail and uses straightforward phrasing to convey the primary feature addition.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@atharvf14t
Copy link
Author

I have read the CLA Document and I hereby sign the CLA

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
.dockerignore (1)

1-8: Consider ignoring build artifacts too.

Add .next/, out/, and similar build outputs to shrink the build context and avoid stale assets catching the Docker cache.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2abc67e and 8bf5eea.

📒 Files selected for processing (2)
  • .dockerignore (1 hunks)
  • Dockerfile (1 hunks)

Comment on lines +15 to +17
RUN npx prisma generate

RUN npm run build
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

Install openssl in the builder stage.

npx prisma generate runs in this stage, but this layer never installs openssl, so the Prisma engine fails with libssl.so missing on Alpine. Install it (and keep it cached) before calling prisma generate.

 FROM node:18-alpine AS builder
 WORKDIR /app

+RUN apk add --no-cache openssl
+
 COPY --from=deps /app/node_modules ./node_modules
 COPY . .
 
 RUN npx prisma generate
🤖 Prompt for AI Agents
In Dockerfile around lines 15 to 17, the builder stage runs "npx prisma
generate" but never installs OpenSSL, causing Prisma's engine to fail with a
missing libssl.so; add an installation step for OpenSSL in the builder stage
before running "npx prisma generate" (for Alpine: RUN apk add --no-cache
openssl) and place it in an earlier layer (before npm install / prisma generate)
so the package is cached between builds.

@atharvf14t atharvf14t closed this Oct 7, 2025
@github-actions github-actions bot locked and limited conversation to collaborators Oct 7, 2025
@atharvf14t atharvf14t reopened this Oct 7, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant