Files
infocom-systems-design/node_modules/@zenuml/core/Dockerfile
2025-10-03 22:27:28 +03:00

37 lines
857 B
Docker

FROM node:20-slim AS base
# Set environment variables for pnpm
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
ENV DOCKER=true
# Enable corepack to use pnpm
RUN corepack enable
# Set the working directory
WORKDIR /app
# Copy the project files to the working directory
COPY . .
RUN pnpm add -g serve
FROM base As prod-deps
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile --prod --ignore-scripts
FROM base AS deps
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile
FROM base AS build
COPY --from=deps /app/node_modules /app/node_modules
RUN pnpm build:site
FROM base
COPY --from=prod-deps /app/node_modules /app/node_modules
COPY --from=build /app/dist /app/dist
# Expose the port the app runs on
EXPOSE 8080
# Command to run the application
CMD ["serve", "-s", "dist", "-l", "8080"]