Nginx Static Site Dockerfile Generator: Complete Guide
Serving Static Sites with Nginx in Docker
For static sites built with tools like Vite, Create React App, or plain HTML, Nginx Alpine is the ideal Docker base image. At just ~25MB, it provides a battle-tested web server with built-in gzip compression and efficient static file serving.
FROM nginx:alpine
COPY . /usr/share/nginx/html
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]