wzj-vue/Dockerfile
2025-01-10 15:30:46 +08:00

21 lines
581 B
Docker
Raw 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.

# 使用官方的nginx:1.22.1镜像作为基础镜像
FROM nginx:1.22.1
# 维护者信息
LABEL maintainer="Lion Li"
# 创建项目相关的目录
RUN mkdir -p /usr/share/nginx/html
# 将前端项目构建后的dist文件夹内容复制到nginx的静态资源目录中
COPY ./dist /usr/share/nginx/html
# 可以根据需要自定义nginx的配置文件这里假设你的配置文件在当前目录下的nginx.conf
COPY ./nginx.conf /etc/nginx/nginx.conf
# 暴露80端口这是nginx默认的端口
EXPOSE 80
# 启动nginx服务
ENTRYPOINT ["nginx", "-g", "daemon off;"]