# build environment FROM node:14 as builder WORKDIR /app ENV PATH /app/node_modules/.bin:$PATH ENV REACT_APP_BASE $BASE_PATH ENV PUBLIC_URL $BASE_PATH/admin COPY package.json ./ COPY package-lock.json ./ RUN npm install COPY . ./ RUN REACT_APP_BASE=/changzhou PUBLIC_URL=/changzhou/admin GENERATE_SOURCEMAP=false node scripts/build.js # production environment FROM nginx:stable-alpine COPY --from=builder /app/dist /etc/nginx/html COPY nginx/nginx.conf /etc/nginx/nginx.conf COPY nginx/default.conf /etc/nginx/conf.d/default.conf EXPOSE 80 CMD ["nginx", "-g", "daemon off;"]