Skip to content

Commit d3fdc73

Browse files
committed
Improved the prod dockerfile to be less clowded (#42)
1 parent 98d4a0e commit d3fdc73

File tree

2 files changed

+13
-12
lines changed

2 files changed

+13
-12
lines changed

.docker/Dockerfile.prod.service

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1-
FROM node:22-slim AS build
1+
FROM node:22-slim AS base
22
ENV PNPM_HOME="/pnpm"
33
ENV PATH="$PNPM_HOME:$PATH"
4-
RUN corepack enable
5-
RUN corepack use pnpm
6-
ARG ServiceName
7-
4+
RUN npm i -g pnpm@latest
85
WORKDIR /app
9-
COPY pnpm-*.yaml ./
10-
COPY tsconfig.*.json ./
116

12-
COPY libs/hmi-helper ./libs/hmi-helper
13-
COPY /packages/$ServiceName ./packages/$ServiceName
7+
FROM base AS build
8+
ARG ServiceName
9+
COPY . .
1410
RUN pnpm install
11+
RUN pnpm --filter ${ServiceName} build
12+
RUN pnpm deploy --filter ${ServiceName} /build
13+
14+
FROM base AS prod
15+
WORKDIR /app
16+
COPY --from=build /build /app/
1517

16-
WORKDIR /app/packages/$ServiceName
17-
RUN pnpm build
1818
CMD [ "pnpm", "start" ]

.npmrc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
shamefully-hoist=true
1+
shamefully-hoist=true
2+
inject-workspace-packages=true

0 commit comments

Comments
 (0)