A very small Docker image (~200KB) to run any static website, based on the thttpd static file server.
For more details, check out my article.
The image is hosted on Docker Hub:
FROM lipanski/docker-static-website:latest
# Copy your static files
COPY . .
Build the image:
docker build -t my-static-website .
Run the image:
docker run -it --rm -p 3000:3000 my-static-website
Browse to http://localhost:3000
.
If you need to configure the server in a different way, you can override the CMD
line:
FROM lipanski/docker-static-website:latest
# Copy your static files
COPY . .
CMD ["/thttpd", "-D", "-h", "0.0.0.0", "-p", "3000", "-d", "/home/static", "-u", "static", "-l", "-", "-M", "60"]