Configure nginx to try .html extension for clean URLs like /music/shadow 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
41 lines
809 B
Docker
41 lines
809 B
Docker
# Build stage
|
|
FROM ruby:3.4.1-alpine AS builder
|
|
|
|
# Install build dependencies
|
|
RUN apk add --no-cache build-base nodejs npm && npm install -g pnpm
|
|
|
|
# Set working directory
|
|
WORKDIR /app
|
|
|
|
# Copy package files and install Node dependencies
|
|
COPY package.json pnpm-lock.yaml ./
|
|
RUN pnpm install --frozen-lockfile
|
|
|
|
# Copy Gemfile and install Ruby dependencies
|
|
COPY Gemfile Gemfile.lock ./
|
|
RUN bundle install
|
|
|
|
# Copy source files
|
|
COPY . .
|
|
|
|
# Build assets with pnpm
|
|
RUN pnpm build:all
|
|
|
|
# Build Jekyll site
|
|
RUN bundle exec jekyll build
|
|
|
|
# Production stage
|
|
FROM nginx:alpine
|
|
|
|
# Copy custom nginx configuration
|
|
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
|
|
|
# Copy built site from builder
|
|
COPY --from=builder /app/_site /usr/share/nginx/html
|
|
|
|
# Expose port 80
|
|
EXPOSE 80
|
|
|
|
# Start nginx
|
|
CMD ["nginx", "-g", "daemon off;"]
|