Files
Aut.ManagementFaculty/Dockerfile
T
smhk1376andCursor c97498a2ae
Deploy edu.mstaut.ir / deploy (push) Successful in 5m56s
Fix deploy health check for /mstcontroller and cut ready-loop waste.
Admin login moved off /admin; old path caused 404 spam for up to two minutes. Slim smoke checks, shorter retries, quieter migrate logs, and npm ci without audit in the image build.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-16 16:57:31 +03:30

47 lines
1.4 KiB
Docker
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# syntax=docker/dockerfile:1
# ---- Dependencies ----
FROM node:22-alpine AS deps
WORKDIR /app
COPY package.json package-lock.json ./
# Skip audit/fund in image builds (saves ~30–60s); keep npm cache across deploys.
RUN --mount=type=cache,target=/root/.npm \
npm ci --no-audit --no-fund
# ---- Builder ----
FROM node:22-alpine AS builder
WORKDIR /app
ARG NEXT_PUBLIC_SITE_URL=https://edu.mstaut.ir
ENV NEXT_PUBLIC_SITE_URL=$NEXT_PUBLIC_SITE_URL
ENV NEXT_TELEMETRY_DISABLED=1
# Skip React Compiler in image builds (big CPU/RAM cost on self-hosted runners)
ENV DISABLE_REACT_COMPILER=1
ENV NODE_OPTIONS=--max-old-space-size=3072
COPY --from=deps /app/node_modules ./node_modules
COPY . .
# Explicit webpack: Next 16 default Turbopack often stalls/OOMs in constrained CI
RUN npm run build
# ---- Runner ----
FROM node:22-alpine AS runner
WORKDIR /app
ENV NODE_ENV=production
ENV NEXT_TELEMETRY_DISABLED=1
ENV PORT=3000
ENV HOSTNAME=0.0.0.0
RUN addgroup --system --gid 1001 nodejs \
&& adduser --system --uid 1001 nextjs
COPY --from=builder /app/public ./public
COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static
# Writable dir for admin image uploads (mount a volume in compose for persistence)
RUN mkdir -p ./public/uploads && chown -R nextjs:nodejs ./public/uploads
USER nextjs
EXPOSE 3000
CMD ["node", "server.js"]