forked from ZenUml/core
-
Notifications
You must be signed in to change notification settings - Fork 8
/
Dockerfile
36 lines (26 loc) · 857 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
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"]