hatch-surf/Dockerfile
Chris Anderson 04265fda3b
Some checks failed
Build and Deploy hatch.surf / build (push) Failing after 12s
Fix Docker build - enable Next.js static export
- Updated Dockerfile to install pnpm@9 explicitly
- Enabled static export in next.config.ts (output: export)
- Removed pnpm-workspace.yaml (not needed for single project)
- Docker build now succeeds and serves static files

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-06-24 10:07:44 +02:00

33 lines
690 B
Docker

# Stage 1: Build
FROM node:20-alpine AS builder
WORKDIR /app
# Install pnpm
RUN npm install -g pnpm@9
# Install dependencies
COPY package.json pnpm-lock.yaml ./
RUN pnpm install --frozen-lockfile
# Build the application
COPY . .
RUN pnpm build
# Stage 2: Production
FROM nginx:alpine AS production
# Copy custom nginx config
COPY nginx.conf /etc/nginx/conf.d/default.conf
# Copy built assets from builder
COPY --from=builder /app/.next/static /usr/share/nginx/html/_next/static
COPY --from=builder /app/out /usr/share/nginx/html
# Expose port (internal only, no SSL)
EXPOSE 80
# Health check
HEALTHCHECK --interval=30s --timeout=3s \
CMD wget -qO- http://localhost:80/ || exit 1