import Link from "next/link"; import Image from "next/image"; export default function Home() { return (

Welcome to Next.js on Docker!

A production-ready example demonstrating how to Dockerize Next.js applications using static export mode with Nginx.

Static Export Mode

This example showcases Next.js static export mode, which creates a fully static site served by Nginx. Perfect for blogs, docs, and marketing sites.

  • Multi-stage Docker build for optimal image size
  • Production-ready Nginx configuration
  • Security best practices (non-root user)
  • BuildKit cache mounts for faster builds
  • Gzip compression & static asset caching with Nginx configuration

Quick Start

Build the image:

docker build -t nextjs-static-export .

Run the container:

docker run -p 8080:8080 nextjs-static-export

Or use Docker Compose:

docker compose up
Access at: http://localhost:8080

Next.js Resources

Docker Resources

); }