forked from aeharding/voyager
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
55 lines (36 loc) · 949 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
52
53
54
55
FROM docker.io/library/node:lts-alpine AS base
# Prepare work directory
WORKDIR /wefwef
FROM base AS builder
RUN corepack enable
# Prepare deps
RUN apk update
RUN apk add git --no-cache
# Prepare build deps ( ignore postinstall scripts for now )
COPY package.json ./
COPY pnpm-lock.yaml ./
RUN pnpm config set network-timeout 300000
RUN pnpm install --frozen-lockfile --ignore-scripts
# Copy all source files
COPY . ./
# Build
RUN pnpm build
FROM base AS runner
ARG UID=911
ARG GID=911
RUN corepack enable
COPY package.json ./
COPY pnpm-lock.yaml ./
COPY server.mjs ./
RUN pnpm config set network-timeout 300000
RUN pnpm install --prod --frozen-lockfile --ignore-scripts
# Create a dedicated user and group
RUN set -eux; \
addgroup -g $GID wefwef; \
adduser -u $UID -D -G wefwef wefwef;
USER wefwef
ENV NODE_ENV=production
COPY --from=builder /wefwef/dist ./dist
EXPOSE 5314/tcp
ENV PORT=5314
CMD ["node", "./server.mjs"]