-
Notifications
You must be signed in to change notification settings - Fork 3
/
Dockerfile
40 lines (25 loc) · 934 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
FROM docker.io/node:20-alpine AS builder
RUN corepack enable
WORKDIR /app
ENV CI=true
# Files required by pnpm to fetch dependencies
COPY .npmrc package.json pnpm-lock.yaml ./
RUN pnpm fetch
# Bundle app source
COPY . ./
RUN pnpm install -r --offline --frozen-lockfile
# Build
RUN pnpm -r --filter pandora-common --filter 'pandora-server-*' run build
# Shrinkwrap for deployment
RUN pnpm deploy --filter=pandora-server-directory --prod /app/deploy/directory
RUN pnpm deploy --filter=pandora-server-shard --prod /app/deploy/shard
# Directory production image
FROM docker.io/node:20-alpine AS pandora-server-directory
WORKDIR /app
COPY --from=builder /app/deploy/directory /app
CMD ["node", "--enable-source-maps", "dist/index.js"]
# Shard production image
FROM docker.io/node:20-alpine AS pandora-server-shard
WORKDIR /app
COPY --from=builder /app/deploy/shard /app
CMD ["node", "--enable-source-maps", "dist/index.js"]