# 拉取nginx镜像 FROM nginx:alpine ENV TZ=Asia/Shanghai RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo '$TZ' > /etc/timezone && \ mv /etc/nginx/conf.d/default.conf /etc/nginx/conf.d/default-conf-bak # 运行nginx.config文件 ADD nginx/default.conf /etc/nginx/conf.d/default.conf # dist文件夹下的index.html替换到nginx的html ADD dist/ /usr/share/nginx/html/ # 暴露容器端口 EXPOSE 8000 CMD [ "nginx", "-g", "daemon off;" ]