-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
32 lines (25 loc) · 795 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
FROM node:lts-alpine AS base
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
RUN corepack enable
WORKDIR /workspace
FROM base AS deps
COPY package.json pnpm-lock.yaml ./
RUN --mount=type=cache,id=pnpm,target=/pnpm/store \
pnpm install --frozen-lockfile
FROM deps AS build
WORKDIR /workspace
COPY src src
COPY tsconfig.build.json tsconfig.json ./
RUN pnpm run build
FROM deps AS pruned
RUN --mount=type=cache,id=pnpm,target=/pnpm/store \
pnpm --filter enmon-adapter --prod deploy pruned
FROM node:lts-alpine AS runtime
LABEL org.opencontainers.image.source=https:/hekystyle/enmon-adapter
WORKDIR /app
ENV NODE_ENV=production
COPY --from=build /workspace/dist .
COPY --from=pruned /workspace/pruned .
COPY config/default.yml config/default.yml
CMD ["node", "main.js"]