-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
49 lines (32 loc) · 871 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
FROM docker.io/library/node:lts-alpine AS base
# Prepare work directory
WORKDIR /inprove
FROM base AS builder
# Prepare pnpm https://pnpm.io/installation#using-corepack
RUN corepack enable
# Prepare deps
RUN apk update
RUN apk add git --no-cache
# Prepare build deps ( ignore postinstall scripts for now )
COPY .npmrc ./
COPY package.json ./
COPY pnpm-lock.yaml ./
# Copy all source files
COPY . ./
# Run full install with every postinstall script ( This needs project file )
RUN pnpm i --frozen-lockfile
# Build
RUN pnpm build
FROM base AS runner
ARG UID=911
ARG GID=911
# Create a dedicated user and group
RUN set -eux; \
addgroup -g $GID inprove; \
adduser -u $UID -D -G inprove inprove;
USER inprove
ENV NODE_ENV=production
COPY --from=builder /inprove/.output ./.output
EXPOSE 3000/tcp
ENV PORT=3000
CMD ["node", ".output/server/index.mjs"]