Dockerfile 449 B

12345678910111213141516
  1. #基于官方 NGINX 镜像部署(精简镜像)
  2. FROM nginx:alpine
  3. # 复制本地打包好的 dist 目录到 NGINX 静态资源目录
  4. COPY ./dist /usr/share/nginx/html
  5. # 替换 NGINX 默认配置(用我们自定义的 nginx.conf)
  6. COPY ./nginx.conf /etc/nginx/nginx.conf
  7. # 暴露容器端口(与 nginx.conf 中 listen 一致)
  8. #EXPOSE 80
  9. # 启动 NGINX(前台运行,避免容器启动后退出)
  10. CMD ["nginx", "-g", "daemon off;"]