-
-
Notifications
You must be signed in to change notification settings - Fork 11
/
Dockerfile
51 lines (35 loc) · 975 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
51
FROM node:20-alpine AS runtime_deps
RUN corepack enable
WORKDIR /app
COPY package.json .
COPY pnpm-lock.yaml .
COPY .npmrc .
ENV CI=1
ENV NODE_ENV=production
# Install dependencies
RUN pnpm install --frozen-lockfile
FROM node:20-alpine AS docs
RUN corepack enable
WORKDIR /app
COPY package.json .
COPY pnpm-lock.yaml .
COPY .npmrc .
COPY docs/openapi.yaml docs/openapi.yaml
ENV CI=1
# Install dependencies
RUN pnpm install --frozen-lockfile
RUN pnpm run docs
FROM node:20-alpine
RUN corepack enable
WORKDIR /app
COPY . .
COPY --from=runtime_deps /app/node_modules node_modules
COPY --from=docs /app/redoc-static.html .
# Run with...
# Source maps enabled, since it does not affect performance from what I found
ENV NODE_OPTIONS="--enable-source-maps"
# Warnings disabled, we know what we're doing and they're annoying
ENV NODE_NO_WARNINGS=1
# Use production in case any dependencies use it in any way
ENV NODE_ENV=production
CMD ["pnpm", "--silent", "start"]