halverneus/static-file-serverTiny, simple static file server using environment variables for configuration. Install from any of the following locations:
Default values are shown with the associated environment variable.
bash# Enables resource access from any domain. CORS=false # Enable debugging for troubleshooting. If set to 'true' this prints extra # information during execution. IMPORTANT NOTE: The configuration summary is # printed to stdout while logs generated during execution are printed to stderr. DEBUG=false # Optional Hostname for binding. Leave black to accept any incoming HTTP request # on the prescribed port. HOST= # If assigned, must be a valid port number. PORT=8080 # Automatically serve the index file for a given directory (default). If set to # 'false', URLs ending with a '/' will return 'NOT FOUND'. SHOW_LISTING=true # Folder with the content to serve. FOLDER=/web # URL path prefix. If 'my.file' is in the root of $FOLDER and $URL_PREFIX is # '/my/place' then file is retrieved with '[***] URL_PREFIX= # Paths to the TLS certificate and key. If one is set then both must be set. If # both set then files are served using HTTPS. If neither are set then files are # served using HTTP. TLS_CERT= TLS_KEY= # If TLS certificates are set then the minimum TLS version may also be set. If # the value isn't set then the default minimum TLS version is 1.0. Allowed # values include "TLS10", "TLS11", "TLS12" and "TLS13" for TLS1.0, TLS1.1, # TLS1.2 and TLS1.3, respectively. The value is not case-sensitive. TLS_MIN_VERS= # List of accepted HTTP referrers. Return 403 if HTTP header `Referer` does not # match prefixes provided in the list. # Examples: # 'REFERRERS=http://localhost,https://...,https://another.name' # To accept missing referrer header, add a blank entry (start comma): # 'REFERRERS=,http://localhost,https://another.name' REFERRERS=
YAML settings are individually overridden by the corresponding environment variable. The following is an example configuration file with defaults. Pass in the path to the configuration file using the command line option ('-c', '-config', '--config').
yamlcors: false debug: false folder: /web host: "" port: 8080 referrers: [] show-listing: true tls-cert: "" tls-key: "" tls-min-vers: "" url-prefix: ""
Example configuration with possible alternative values:
yamldebug: true folder: /var/www port: 80 referrers: - http://localhost - [***]
bashPORT=8888 FOLDER=. ./serve
Files can then be accessed by going to http://localhost:8888/my/file.txt
bashdocker run -d \ -v /my/folder:/web \ -p 8080:8080 \ halverneus/static-file-server:latest
This will serve the folder "/my/folder" over http://localhost:8080/my/file.txt
Any of the variables can also be modified:
bashdocker run -d \ -v /home/me/dev/source:/content/html \ -v /home/me/dev/files:/content/more/files \ -e FOLDER=/content \ -p 8080:8080 \ halverneus/static-file-server:latest
bash./serve help # OR docker run -it halverneus/static-file-server:latest help
探索更多轩辕镜像的使用方法,找到最适合您系统的配置方式
通过 Docker 登录认证访问私有仓库
在 Linux 系统配置镜像服务
在 Docker Desktop 配置镜像
Docker Compose 项目配置
Kubernetes 集群配置 Containerd
K3s 轻量级 Kubernetes 镜像加速
VS Code Dev Containers 配置
MacOS OrbStack 容器配置
在宝塔面板一键配置镜像
Synology 群晖 NAS 配置
飞牛 fnOS 系统配置镜像
极空间 NAS 系统配置服务
爱快 iKuai 路由系统配置
绿联 NAS 系统配置镜像
QNAP 威联通 NAS 配置
Podman 容器引擎配置
HPC 科学计算容器配置
ghcr、Quay、nvcr 等镜像仓库
无需登录使用专属域名
需要其他帮助?请查看我们的 常见问题Docker 镜像访问常见问题解答 或 提交工单
免费版仅支持 Docker Hub 访问,不承诺可用性和速度;专业版支持更多镜像源,保证可用性和稳定速度,提供优先客服响应。
专业版支持 docker.io、gcr.io、ghcr.io、registry.k8s.io、nvcr.io、quay.io、mcr.microsoft.com、docker.elastic.co 等;免费版仅支持 docker.io。
当返回 402 Payment Required 错误时,表示流量已耗尽,需要充值流量包以恢复服务。
通常由 Docker 版本过低导致,需要升级到 20.x 或更高版本以支持 V2 协议。
先检查 Docker 版本,版本过低则升级;版本正常则验证镜像信息是否正确。
使用 docker tag 命令为镜像打上新标签,去掉域名前缀,使镜像名称更简洁。
来自真实用户的反馈,见证轩辕镜像的优质服务