-
-
Notifications
You must be signed in to change notification settings - Fork 166
/
Dockerfile
50 lines (32 loc) · 1.08 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
# stage 0: set base image w/common customizations
FROM docker.io/library/node:lts-alpine AS base
# Prepare work directory
WORKDIR /voyager
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
ENV BUILD_FOSS_ONLY=true
# enable corepack & set network-timeout
RUN corepack enable &&\
pnpm config set network-timeout 300000
# stage 1: build
FROM base AS builder
# Prepare deps
RUN apk add --no-cache git
# Prepare build deps ( ignore postinstall scripts for now )
COPY package.json pnpm-lock.yaml ./
COPY patches ./patches
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile --ignore-scripts
# Copy all source files
COPY build.sh disable_in_app_purchases.sh index.html vite.config.ts manifest.json tsconfig.json ./
COPY public ./public
COPY src ./src
# Build
RUN pnpm build
# stage 2: runtime
FROM docker.io/library/nginx AS runner
ARG UID=911 GID=911
COPY generate_config.sh /docker-entrypoint.d/generate_config.sh
COPY nginx.conf.template /etc/nginx/templates/default.conf.template
COPY --from=builder /voyager/dist /var/www
ENV NGINX_PORT=5314
EXPOSE 5314/tcp