pegase-z3-frontend/Dockerfile
2025-08-10 12:00:35 +02:00

21 lines
634 B
Docker

FROM node:22-alpine AS build
WORKDIR /app
COPY . .
# Needed for Vite to define the environment variables that are importable in the code
COPY .env.example .env
RUN npm install
RUN npm run build
FROM node:22-alpine AS production
WORKDIR /app
RUN rm -rf ./*
COPY --from=build /app/package.json .
COPY --from=build /app/build .
ENV NODE_ENV=production
RUN npm install --omit=dev
# For uploading large files, set the body size limit to Infinity
# Size limit is delegated to SvelteKit handle function.
# https://svelte.dev/docs/kit/adapter-node#Environment-variables-BODY_SIZE_LIMIT
ENV BODY_SIZE_LIMIT=Infinity
CMD ["node", "index.js"]