FROM $image_prefix-env-fe/screen  AS build

MAINTAINER afa

WORKDIR /usr/local/nginx

COPY src/fe/screen /opt/fe/screen
RUN  export PATH=$PATH:/usr/local/node/bin  && \
     npm config set registry https://registry.npm.taobao.org && \
     cd /opt/fe/screen && \
     rm -rf /opt/fe/screen/.git && \
     npm i -g yarn && \
     yarn config set registry https://registry.npm.taobao.org && \
     yarn && \
     yarn build


FROM $image_prefix-base-fe/screen  

MAINTAINER afa

COPY --from=build /opt/fe/screen/dist /usr/share/nginx/html/

CMD ["/etc/nginx/sbin/nginx","-g","daemon off;"]
