-
Notifications
You must be signed in to change notification settings - Fork 51
/
Dockerfile
33 lines (19 loc) · 626 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
### STAGE 1: Build ###
# We label our stage as ‘builder’
FROM node:18.13.0-alpine3.17 as builder
USER root
COPY package.json yarn.lock ./
## Storing node modules on a separate layer will prevent unnecessary npm installs at each build
RUN yarn install --immutable && mkdir /next-app && mv ./node_modules ./next-app
WORKDIR /next-app
COPY . .
## Build the Next app in production mode and store the artifacts in dist folder
RUN yarn cache clean --force
ARG key
ENV STEAMGRIDDB_KEY $key
RUN yarn prefetch
RUN yarn build
RUN yarn export
### STAGE 2: Setup ###
FROM scratch
COPY --from=builder /next-app/out /app/