2019-11-28 15:08:33 +01:00
2019-09-05 23:53:49 +02:00
2019-09-06 00:04:57 +02:00
2019-09-05 23:53:49 +02:00
2019-09-05 23:53:49 +02:00
2019-11-28 12:16:58 +01:00
2019-09-05 23:53:49 +02:00
2019-09-05 23:53:49 +02:00
2019-11-28 12:16:58 +01:00
2019-11-28 14:09:06 +01:00
2019-11-28 14:09:06 +01:00
2019-10-10 23:30:48 +02:00
2019-10-10 23:30:48 +02:00
2019-11-28 15:08:33 +01:00
2019-11-28 14:33:01 +01:00
2019-09-05 23:53:49 +02:00
2019-09-05 23:53:49 +02:00

Static Web Server Build Status Docker Image

A blazing fast static files-serving web server powered by Rust Iron.

Static Web Server is a small (1.4M static binary) and fast web server to serving static files like html files or assets.

It's also an option to deploy it inside a Docker container.

Status: It's in beta yet. Feel free to contribute.

Usage

Server is configured via environment variables:

  • SERVER_NAME: Name for server. Default my-static-server.
  • SERVER_HOST: Host address (E.g 127.0.0.1). Default [::].
  • SERVER_PORT: Host port. Default 80.
  • SERVER_ROOT: Root directory path of static files. Default ./public.
  • SERVER_ASSETS: Assets directory path for add cache headers functionality. Default ./assets but relative to the root.

Docker stack

Example using Traefik proxy:

version: "3.3"

services:
  web:
    image: joseluisq/static-web-server:latest
    environment:
        - SERVER_NAME=my-server
        - SERVER_HOST=127.0.0.1
        - SERVER_PORT=8080
        - SERVER_ROOT=/html
        - SERVER_ASSETS=./assets
    volumes:
        - ./some-dir-path:/html
    labels:
        - "traefik.enable=true"
        - "traefik.frontend.entryPoints=https"
        - "traefik.backend=localhost_dev"
        - "traefik.frontend.rule=Host:localhost.dev"
        - "traefik.port=80"
    networks:
        - traefik_net

networks:
    traefik_net:
        external: true

Contributions

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in current work by you, as defined in the Apache-2.0 license, shall be dual licensed as described below, without any additional terms or conditions.

Feel free to send some Pull request or issue.

License

This work is primarily distributed under the terms of both the MIT license and the Apache License (Version 2.0).

© 2019 Jose Quintana

Languages
Rust 93%
Shell 3.8%
Makefile 1.6%
Dockerfile 1.5%
HTML 0.1%