2023-05-09 23:38:39 +08:00
|
|
|
FROM node:16-alpine as build-stage
|
2023-04-25 22:52:42 +08:00
|
|
|
|
|
|
|
WORKDIR /admim
|
|
|
|
|
2023-05-09 23:38:39 +08:00
|
|
|
COPY .npmrc package.json yarn.lock ./
|
|
|
|
RUN --mount=type=cache,id=yarn-store,target=/root/.yarn-store \
|
|
|
|
yarn install
|
2023-04-25 22:52:42 +08:00
|
|
|
|
|
|
|
COPY . .
|
|
|
|
ARG NODE_ENV=""
|
|
|
|
RUN env ${NODE_ENV} yarn build:prod
|
|
|
|
|
|
|
|
## -- stage: dist => nginx --
|
|
|
|
FROM nginx:alpine
|
|
|
|
|
|
|
|
ENV TZ=Asia/Shanghai
|
|
|
|
|
|
|
|
COPY ./nginx.conf /etc/nginx/conf.d/default.conf
|
2023-05-09 23:38:39 +08:00
|
|
|
COPY --from=build-stage /admim/dist /usr/share/nginx/html
|
2023-04-25 22:52:42 +08:00
|
|
|
|
|
|
|
EXPOSE 80
|