-
Notifications
You must be signed in to change notification settings - Fork 9
/
Dockerfile
52 lines (36 loc) · 1.15 KB
/
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
FROM --platform=$BUILDPLATFORM node:20-alpine AS builder
RUN mkdir -p /app
WORKDIR /app
COPY package.json pnpm-lock.yaml ./
COPY patches ./patches
RUN corepack enable && pnpm i --frozen-lockfile
COPY . .
ARG API_ENDPOINT
ARG OPENGRAPH_ENDPOINT
ARG DISCORD_INVITE
ARG SUPPORT_MAIL
ARG GTM_ID
ARG GA_ID
ARG USE_ACCOUNT=false
ARG PUBLIC_TELEMETRY_ENDPOINT
ARG PUBLIC_TELEMETRY_API_KEY
ENV IS_RELEASE=1
RUN apk add git && \
PUBLIC_API_ENDPOINT=${API_ENDPOINT} PUBLIC_OPENGRAPH_ENDPOINT=${OPENGRAPH_ENDPOINT} \
PUBLIC_DISCORD_INVITE=${DISCORD_INVITE} PUBLIC_SUPPORT_MAIL=${SUPPORT_MAIL} \
PUBLIC_GTM_ID=${GTM_ID} PUBLIC_GA_ID=${GA_ID} PUBLIC_USE_ACCOUNT=${USE_ACCOUNT} \
pnpm build && \
mv static/~partytown build/client/~partytown
RUN apk add jq
RUN cat package.json | jq 'del(.devDependencies) | del(.resolutions) | del(.scripts)' | tee package.json
RUN pnpm pack && mv adofai-gg-*.tgz package.tgz
FROM node:20-alpine AS runner
COPY --from=builder /app/package.tgz .
RUN tar xvzf package.tgz && \
rm package.tgz && \
mv package app && \
cd app && \
corepack enable && \
pnpm i --production
WORKDIR /app
CMD ["node", "server.js"]