2019-11-06 22:29:04 +08:00
|
|
|
FROM node:alpine AS builder
|
|
|
|
WORKDIR /app
|
|
|
|
COPY . .
|
2020-08-29 04:58:46 +08:00
|
|
|
# Using yarn to install dependencies in CI will cause network timeout
|
|
|
|
# Refer to https://github.com/date-fns/date-fns/issues/1004
|
2020-09-05 00:02:53 +08:00
|
|
|
RUN yarn config set network-timeout 300000 \
|
|
|
|
&& yarn \
|
|
|
|
&& yarn build \
|
|
|
|
# remove source maps - people like small image
|
2021-06-05 23:09:27 +08:00
|
|
|
&& rm public/*.map || true
|
2019-11-06 22:29:04 +08:00
|
|
|
|
|
|
|
FROM nginx:alpine
|
|
|
|
RUN rm -rf /usr/share/nginx/html/*
|
|
|
|
COPY --from=builder /app/public /usr/share/nginx/html
|
|
|
|
CMD ["nginx", "-g", "daemon off;"]
|