- # 使用官方的Nginx基础镜像
- FROM nginx:latest
- # 删除默认配置文件
- RUN rm /etc/nginx/conf.d/default.conf
- # 将本地的Nginx配置文件复制到容器中
- COPY nginx.conf /etc/nginx/conf.d/
- # 将本地的静态文件复制到容器的指定目录下
- COPY static /usr/share/nginx/html/static
- # 暴露Web服务器的端口
- EXPOSE 80
- # 设置启动命令
- CMD ["nginx", "-g", "daemon off;"]
复制代码
|