We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6776ef5 commit 702ca77Copy full SHA for 702ca77
1 file changed
Dockerfile
@@ -22,14 +22,14 @@ RUN hugo version
22
RUN git clone --depth 1 https://github.com/hugo-fixit/hugo-fixit-starter.git /build
23
WORKDIR /build
24
25
-# 关键:覆盖 baseURL 为根路径,避免子目录前缀
+# 构建到绝对路径 /public,并设置 baseURL 为根
26
RUN hugo --minify --baseURL "/" --destination /public
27
28
# 验证首页存在
29
RUN test -f /public/index.html
30
31
# 阶段二:Nginx 服务
32
FROM nginx:stable-alpine
33
-COPY --from=builder /build/public /usr/share/nginx/html
+COPY --from=builder /public /usr/share/nginx/html
34
EXPOSE 80
35
CMD ["nginx", "-g", "daemon off;"]
0 commit comments