From 63a869a39082919c8f9a9599b8ee40d303cabb62 Mon Sep 17 00:00:00 2001 From: GoCo Date: Tue, 22 Jul 2025 17:56:19 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=F0=9F=90=9B=20dockerfile=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E6=9D=83=E9=99=90=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Dockerfile b/Dockerfile index 0598e9b..a485dcf 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,4 +7,9 @@ RUN npm install && npm run build # 使用 nginx 作为生产环境 FROM nginx:stable-alpine COPY --from=builder /app/dist /usr/share/nginx/html + +# 设置静态资源的访问权限,避免 403 Forbidden +RUN find /usr/share/nginx/html -type f -exec chmod 644 {} \; \ + && find /usr/share/nginx/html -type d -exec chmod 755 {} \; + COPY nginx.conf /etc/nginx/conf.d/default.conf