/docker-serve-dir

Serve a directory with static files with a docker container

Primary LanguageJavaScriptMIT LicenseMIT

License MIT Analytics

This image allows you to serve static files. It's a NodeJS server application, that uses express, serve-index and serve-static libraries to allow user-friendly file listing. If a file is being clicked - download is forced.

Usage

Example:

docker run -d \
    --name serve-dir-index \
    -p 30000:3000 \
    -v "/home/files-to-serve/:/home/serve-dir-index/" \
    -e "servePath=/home/serve-dir-index/" \
    andrejkosyak/docker-serve-dir:latest

Config

Environment (required) An -e variable should be passed for servePath. This would be the index folder.

Volume (optional) You can map a volume or just serve from the container filesystem.