You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
Jake Howard 19e34780a9
Remove healthcheck
2 weeks ago
.github/workflows Test Nginx config 1 year ago
Dockerfile Remove healthcheck 2 weeks ago
LICENSE Create LICENSE 5 months ago
README.md Document that the user can be configured 2 months ago
default.conf Add missing trailing semi 11 months ago
docker-compose.yml Init docker workflow 1 year ago
docker-entrypoint.sh Quote variable 2 months ago

README.md

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.

"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)