Dockerfile 422 B

12345678910111213141516171819
  1. FROM node:14.15.0 as builder
  2. WORKDIR /opt/ferry_web
  3. COPY . .
  4. RUN npm install -g cnpm --registry=https://registry.npm.taobao.org && cnpm install
  5. RUN npm run build:prod
  6. FROM nginx:1.18.0
  7. COPY --from=builder /opt/ferry_web/web /opt/web
  8. COPY docker/nginx.conf /etc/nginx/nginx.conf
  9. COPY docker/entrypoint.sh /entrypoint.sh
  10. ENV LISTEN_DOMAIN=fdevops.com
  11. #暴露容器8001端口
  12. EXPOSE 8001
  13. ENTRYPOINT [ "/entrypoint.sh" ]