Files
hldrCenter/web/Dockerfile

19 lines
734 B
Docker
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 基础镜像使用官方NginxAlpine版本体积更小
FROM nginx:alpine
# 维护者信息(可选)
LABEL maintainer="Mayiming"
# 将本地打包后的静态文件dist目录复制到Nginx的默认站点目录
# Nginx默认会从 /usr/share/nginx/html 目录加载静态文件
COPY dist/ /usr/share/nginx/html/
# 可选如果需要自定义Nginx配置复制本地的nginx.conf到容器的Nginx配置目录
# 覆盖默认的配置解决SPA路由问题时需要
COPY nginx.conf /etc/nginx/conf.d/default.conf
# 暴露容器的80端口Nginx默认监听80端口
EXPOSE 80
# 容器启动时自动启动Nginx官方Nginx镜像已默认配置可省略
CMD ["nginx", "-g", "daemon off;"]