This is a lightweight file server built with Flask, featuring:
-
HTTP file browsing (like python3 -m http.server)
-
HTTP Basic Authentication
-
Configurable via environment variables
-
Dockerized for easy deployment
Installation from Docker registry hub.
You can download the image with the following command:
docker pull mattmcn9/flask-basic-authThis image uses environment variables to allow the configuration of some parameters at run time:
- Variable name:
USERNAME - Default value: user
- Accepted values: Any string. Avoid whitespaces and special chars.
- Description: Username for the login. If you don't specify it through the
USERNAMEenvironment variable at run time,userwill be used by default.
- Variable name:
PASSWORD - Default value: password
- Accepted values: Any string. Avoid whitespaces and special chars.
- Description: Password for the login. If you don't specify it through the
PASSWORDenvironment variable at run time,passwordwill be used by default.
- Variable name:
DATA_DIR - Default value: /data
- Accepted values: Any string.
- Description: Data directory for the http service to display. If you don't specify it through the
DATA_DIRenvironment variable at run time,/datawill be used by default.
- Variable name:
PORT - Default value: 8080
- Accepted values: Any port number
- Description: If you don't specify a port number, through the
PORTenvironment variable at run time,8080will be used by default
- Create a temporary container for testing purposes:
docker run --rm -p 8080:8080 mattmcn9/flask-basic-auth- Create a container and set the login information, with a binded data directory:
docker run -d -p 8080:8080 -v /my/data/directory:/data -e USERNAME=myUser -e PASSWORD=MyPassword! --name flask-http-auth mattmcn9/flask-basic-auth