Files
biztaghavisite/Dockerfile.prebuilt
Ali Taghavi 043f351eae Fix prebuilt Docker image Prisma COPY conflict with standalone.
Replace stub @prisma/client from Next standalone with full bundle engines.
Ignore .pnpm-store so it is not committed again.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-19 10:09:24 +03:30

31 lines
1.1 KiB
Docker

# Server-side image — NO npm/pnpm/network. Requires iran-bundle/ from scripts/bundle-for-iran.sh (run on Mac).
FROM docker.arvancloud.ir/library/node:20-slim AS runner
WORKDIR /app
ENV NODE_ENV=production
ENV PORT=3000
ENV HOSTNAME="0.0.0.0"
ENV NEXT_TELEMETRY_DISABLED=1
ENV PRISMA_ENGINES_CHECKSUM_IGNORE_MISSING=1
ENV PRISMA_QUERY_ENGINE_LIBRARY=/app/prisma-binaries/libquery_engine-debian-openssl-3.0.x.so.node
RUN addgroup --system --gid 1001 nodejs && \
adduser --system --uid 1001 nextjs
COPY iran-bundle/standalone ./
COPY iran-bundle/static ./.next/static
COPY iran-bundle/public ./public
COPY iran-bundle/prisma-binaries ./prisma-binaries
# Standalone ships a stub @prisma/client; replace with full Prisma runtime from the bundle.
COPY iran-bundle/node_modules /tmp/prisma-nm
RUN rm -rf ./node_modules/@prisma ./node_modules/.prisma && \
cp -a /tmp/prisma-nm/.prisma ./node_modules/ && \
cp -a /tmp/prisma-nm/@prisma ./node_modules/@prisma && \
rm -rf /tmp/prisma-nm
RUN mkdir -p /app/public/uploads && chown -R nextjs:nodejs /app/public/uploads
USER nextjs
EXPOSE 3000
CMD ["node", "server.js"]