Add Iran offline deploy: Mac bundle + prebuilt Docker image.
Fix pnpm workspace error during prisma generate, and add bundle-for-iran.sh so the app is built on Mac (full internet) and the server only copies artifacts. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
26
Dockerfile.prebuilt
Normal file
26
Dockerfile.prebuilt
Normal file
@@ -0,0 +1,26 @@
|
||||
# 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
|
||||
COPY iran-bundle/node_modules/.prisma ./node_modules/.prisma
|
||||
COPY iran-bundle/node_modules/@prisma ./node_modules/@prisma
|
||||
|
||||
RUN mkdir -p /app/public/uploads && chown -R nextjs:nodejs /app/public/uploads
|
||||
|
||||
USER nextjs
|
||||
EXPOSE 3000
|
||||
CMD ["node", "server.js"]
|
||||
Reference in New Issue
Block a user