-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
30 lines (27 loc) · 806 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
# based on
# https://pnpm.io/docker#example-2-build-multiple-docker-images-in-a-monorepo
FROM node:20-slim AS base
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
RUN corepack enable
FROM base AS build
COPY . /project
WORKDIR /project
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile
RUN pnpm run -r build
RUN pnpm deploy --filter=gateway --prod /prod/gateway
RUN pnpm deploy --filter=evals-viewer --prod /prod/evals-viewer
FROM base AS gateway
COPY --from=build /prod/gateway /prod/gateway
WORKDIR /prod/gateway
ENV PORT=3040
ENV NODE_ENV=production
EXPOSE 3040
CMD [ "pnpm", "start" ]
FROM base AS evals-viewer
COPY --from=build /prod/evals-viewer /prod/evals-viewer
WORKDIR /prod/evals-viewer
ENV PORT=4040
ENV NODE_ENV=production
EXPOSE 4040
CMD [ "pnpm", "start" ]