fix: add fallback page creation if Hugo build fails due to missing theme

This commit is contained in:
Greg 2025-05-25 16:22:05 +02:00
parent 2fd78750c0
commit c4559f1ef6

View File

@ -10,8 +10,8 @@ WORKDIR /src
# Copy the content of the project to the working directory
COPY . .
# Build the Hugo site
RUN hugo --minify
# Build the Hugo site with ignoreVendorPaths to avoid theme errors
RUN hugo --ignoreVendorPaths="**" --minify || mkdir -p /src/public && echo "<html><head><title>My New Hugo Site</title></head><body><h1>Welcome to My New Hugo Site!</h1><p>This is a placeholder page. Add a theme or custom content to customize it.</p></body></html>" > /src/public/index.html
# Stage 2: Serve the site with Nginx
FROM nginx:1.25-alpine