From c9ca09284a2b064af4445427de390e1f2d3f77e2 Mon Sep 17 00:00:00 2001 From: yubin Date: Tue, 29 Apr 2025 23:10:32 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=20Dockerfile=20?= =?UTF-8?q?=E7=94=A8=E4=BA=8E=E5=AE=B9=E5=99=A8=E5=8C=96=E9=83=A8=E7=BD=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..8b8195d9 --- /dev/null +++ b/Dockerfile @@ -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;"] \ No newline at end of file