FROM nginx:alpine MAINTAINER anfioo # 1. 创建 Nginx 日志目录(避免启动时日志文件不存在报错) RUN mkdir -p /var/log/nginx \ && touch /var/log/nginx/access.log \ && touch /var/log/nginx/error.log # 把当前目录下的 nginx.conf 复制到容器的 Nginx 配置目录 COPY nginx.conf /etc/nginx/conf.d/default.conf # 把 html 目录复制到容器的 /usr/share/nginx/html COPY html /MicroCommunityIotWeb EXPOSE 8112 ENTRYPOINT ["nginx","-g","daemon off;"]