
This is useful for people who want to do multi-architecture Docker builds; it means the builder stage need only be run omce for all architectures, even though the final stage needs to be built for *each* architecture.
18 lines
285 B
Docker
18 lines
285 B
Docker
# Builder
|
|
FROM --platform=$BUILDPLATFORM node:current as builder
|
|
|
|
WORKDIR /src
|
|
|
|
COPY . /src
|
|
RUN yarn --network-timeout=100000 install
|
|
RUN yarn build
|
|
|
|
|
|
# App
|
|
FROM nginx:alpine
|
|
|
|
COPY --from=builder /src/build /app
|
|
|
|
RUN rm -rf /usr/share/nginx/html \
|
|
&& ln -s /app /usr/share/nginx/html
|