Skip to content

Commit 702ca77

Browse files
authored
Update Dockerfile
1 parent 6776ef5 commit 702ca77

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,14 @@ RUN hugo version
2222
RUN git clone --depth 1 https://github.com/hugo-fixit/hugo-fixit-starter.git /build
2323
WORKDIR /build
2424

25-
# 关键:覆盖 baseURL 为根路径,避免子目录前缀
25+
# 构建到绝对路径 /public,并设置 baseURL 为根
2626
RUN hugo --minify --baseURL "/" --destination /public
2727

2828
# 验证首页存在
2929
RUN test -f /public/index.html
3030

3131
# 阶段二:Nginx 服务
3232
FROM nginx:stable-alpine
33-
COPY --from=builder /build/public /usr/share/nginx/html
33+
COPY --from=builder /public /usr/share/nginx/html
3434
EXPOSE 80
3535
CMD ["nginx", "-g", "daemon off;"]

0 commit comments

Comments
 (0)