1
0
mirror of https://github.com/PanJiaChen/vue-element-admin.git synced 2025-05-20 16:19:17 +08:00

feat: 添加 Dockerfile 用于容器化部署

This commit is contained in:
yubin 2025-04-29 23:10:32 +08:00
parent 8b83ff1122
commit c9ca09284a

20
Dockerfile Normal file
View File

@ -0,0 +1,20 @@
# 使用官方 nginx 镜像作为基础镜像
FROM nginx:1.24-alpine
# 维护者信息
LABEL maintainer="yubin"
# 删除默认 nginx 静态资源
RUN rm -rf /usr/share/nginx/html/*
# 拷贝前端打包后的文件到 nginx 目录
COPY dist/ /usr/share/nginx/html/
# 拷贝自定义 nginx 配置(可选)
# COPY nginx.conf /etc/nginx/nginx.conf
# 暴露端口
EXPOSE 80
# 启动 nginx
CMD ["nginx", "-g", "daemon off;"]