1
Fork 0
Customizable and performant static file server - powered by Nginx
This repository has been archived on 2026-05-19. You can view files and clone it, but you cannot make any changes to its state, such as pushing and creating new issues, pull requests or comments.
  • Dockerfile 67.7%
  • Shell 32.3%
Find a file
2023-12-14 17:03:05 +00:00
.github/workflows Run on the first, regardless of the day of the week 2023-04-10 17:47:33 +01:00
default.conf Ensure gzip is enabled 2023-04-10 17:30:41 +01:00
docker-compose.yml Init docker workflow 2020-05-09 12:11:46 +01:00
docker-entrypoint.sh Fix config dir 2021-06-22 20:55:52 +01:00
Dockerfile Update alpine Docker tag to v3.19 2023-12-14 17:03:05 +00:00
LICENSE Create LICENSE 2020-12-08 09:57:47 +00:00
README.md Add the ability to add custom nginx config 2021-09-29 21:32:15 +01:00
renovate.json Disable dependency dashboard 2023-03-19 22:16:41 +00:00

Docker Static Server

CI

Customizable and performant static file server - powered by Nginx.

Note: This container is designed for hosting static files, rather than for serving a static site. For that, check out docker-website-server.

"Why not just use nginx:alpine?"

If you're not really bothered, the default nginx container will work just fine for you, however this container has a few modifications which make it more suited to serving static files:

  • Use environment variables for customization
  • Healthcheck endpoint
  • GZIP all files
  • Use X-Forwarded-For header when getting client IP

Nginx makes a brilliant file server regardless of how you use it.

Usage

version: "2.3"

services:
  static:
    image: theorangeone/static-server:latest
    volumes:
      - ".:/srv:ro"
    ports:
      - "80:80"

The server will serve files in the /srv directory. This directory can be mounted read-only.

Customization

This image supports some customizations:

  • $INDEX (on / off): Enable file listing, powered by autoindex
  • $FANCY_INDEX (on / off): Enable file listing, powered by fancy_index
  • $PUID: Set the user nginx runs as (default 1000)

If you'd rather add some additional configuration yourself, you can mount an additional nginx config at /etc/nginx/extra.conf, which will be included in the primary config.