Files
Aut.ManagementFaculty/Dockerfile.prebuilt
T

27 lines
813 B
Docker

# Runtime image for a fully assembled Next.js standalone tree.
# Build context = prebuilt/ and must already contain:
# server.js, .next/BUILD_ID, .next/static/, public/, node_modules/, …
FROM node:22-alpine
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
# Single COPY of an already-complete app root (avoids missing hidden .next)
COPY --chown=nextjs:nodejs . ./
# Next warns/breaks if a legacy root-level ./static exists alongside ./public
RUN rm -rf ./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"]