A Tiny Docker Image for Serving Static Files

📆 2026-10-17 12:30

I could use a much bigger web application to manage downloads, complete with a database, user accounts, and a dashboard but all I want is to serve my own ZIM archive and some other files over HTTP, so I put together a tiny Docker setup using Nginx and Alpine Linux.

Showcase

You can see it in action at:

Downloads - Sava.Rocks

You can also download the latest zim file at:

Download latest Sava.Rocks ZIM file

What are ZIM files ?

ZIM files are compressed archives designed to store entire websites for offline browsing, including text, images, and other resources. They are especially useful for keeping a local copy of a website or accessing knowledge libraries without an Internet connection. You can open them with applications such as Kiwix, available for Linux, Windows, macOS, Android, and iOS.

I just discovered ZIM files

The setup

Dockerfile

This Dockerfile uses the latest Alpine Linux image as its base and installs Nginx to serve static files, along with tzdata for timezone support. It copies the Nginx configuration, the contents of the files/ directory into /app/, and the favicon into the root directory. It then sets the timezone to Europe/Bucharest and starts nginx into the background.

nginx.conf

As you can see /latest serves the sava.rocks.zim archive as a downloadable file with a predefined filename, while / displays a directory listing of files under /app. The directory listing shows human-readable file sizes and modification times in the local timezone, making it easy to browse and download available files directly from the website.

This isn't the whole nginx.conf file. I also use sub_filters to make it look pretty with the same colors present on the main website sava.rocks.

Why ?

Sometimes all you need is a web server and a directory full of files. At the moment you can download the zim archive of https://sava.rocks and my Baofeng images for the UV-5R and the UV-5RM with all 16 PMR channels programmed.

I guess I will add more "files" in the future.

🚶 Back to my blog