-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
50 lines (25 loc) · 944 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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
FROM node:22.11.0-alpine@sha256:b64ced2e7cd0a4816699fe308ce6e8a08ccba463c757c00c14cd372e3d2c763e AS development
WORKDIR /srv/app/
VOLUME /srv/app
ENTRYPOINT ["node", "./src/generator.js"]
FROM node:22.11.0-alpine@sha256:b64ced2e7cd0a4816699fe308ce6e8a08ccba463c757c00c14cd372e3d2c763e AS prepare
WORKDIR /srv/app/
COPY ./pnpm-lock.yaml ./
RUN corepack enable && \
pnpm fetch
COPY ./ ./
RUN pnpm install --offline
FROM prepare AS build
ENV NODE_ENV=production
RUN corepack enable && \
pnpm install --offline --ignore-scripts
FROM prepare AS test
RUN corepack enable && \
pnpm run test
FROM prepare AS collect
COPY --from=build /srv/app/ /srv/app/
COPY --from=test /srv/app/package.json /tmp/package.json
FROM node:22.11.0-alpine@sha256:b64ced2e7cd0a4816699fe308ce6e8a08ccba463c757c00c14cd372e3d2c763e AS production
WORKDIR /srv/app/
COPY --from=collect /srv/app/ ./
ENTRYPOINT ["node", "./src/generator.js"]