karsttech.com/Dockerfile

28 lines
515 B
Text
Raw Normal View History

2025-04-04 20:18:20 -04:00
# Build stage
2025-04-04 22:17:34 -04:00
FROM golang:1.24-alpine AS builder
2025-04-04 20:18:20 -04:00
2025-04-04 22:17:34 -04:00
WORKDIR /app
# Install Hugo and Git
RUN apk add --no-cache hugo
2025-04-04 20:18:20 -04:00
# Copy the repository contents
COPY . .
# Build the site with verbose output
RUN hugo --minify --verbose
2025-04-04 20:18:20 -04:00
# Production stage
FROM nginx:alpine
# Copy the built site from builder
2025-04-04 22:17:34 -04:00
COPY --from=builder /app/public /usr/share/nginx/html
2025-04-04 20:18:20 -04:00
# Copy custom nginx config if needed
# COPY nginx.conf /etc/nginx/conf.d/default.conf
# Expose port 80
EXPOSE 80
# Start nginx
CMD ["nginx", "-g", "daemon off;"]