Sign inSign up

endurasolution/flashlin

By endurasolution

โ€ขUpdated about 19 hours ago

FlashLin combines the power of Nginx, the flexibility of Apache, and the simplicity of Caddy.

Image
1

443

endurasolution/flashlin repository overview

โ FlashLin Docker

Fast, Cached, and Powerful Rust Web Server โ€” container-ready with HTTP/3, automatic HTTPS, TLS, reverse proxy, caching, compression, and PHP-FPM support.

FlashLin Docker Pulls Rust HTTP/3 TLS License

Websiteโ  ยท Documentationโ  ยท GitHubโ  ยท Docker Hubโ 


โ Overview

FlashLin Docker is the containerized deployment of FlashLin, a high-performance Rust web server built on Tokio and Hyper.

It provides a production-oriented container environment for static websites, HTTPS, reverse proxying, WebSockets, PHP-FPM, compression, caching, security features, metrics, and optional HTTP/3 support.

โ Features
  • ๐Ÿš€ High-performance Rust web server, memory-safe, zero unsafe code
  • โšก Tokio + Hyper async runtime
  • ๐ŸŒ HTTP/1.1 + HTTP/2 by default
  • ๐Ÿ›œ HTTP/3 over QUIC โ€” optional, experimental listener (image is built with acme,http3)
  • ๐Ÿ”’ Automatic HTTPS via Let's Encrypt (ACME) โ€” cached accounts, auto-renewal, no restart on renew
  • ๐Ÿ” TLS via rustls โ€” no OpenSSL dependency
  • ๐Ÿ” Reverse proxy with round-robin upstreams, passive failover, and WebSocket upgrade forwarding
  • ๐Ÿ˜ PHP-FPM / FastCGI hosting alongside static files
  • ๐Ÿ“ฆ Gzip + Brotli compression, precompressed .br/.gz sidecar negotiation
  • ๐Ÿ—„๏ธ In-memory response cache (RAM, TTL-based)
  • ๐Ÿท๏ธ ETag / Last-Modified / 304 Not Modified, byte-range requests
  • ๐Ÿ›ก๏ธ Security headers (CSP, HSTS, X-Frame-Options, โ€ฆ) + per-host rate limiting
  • ๐Ÿ“Š Prometheus metrics at /metrics (loopback-only)
  • ๐Ÿงฉ Virtual hosts โ€” one .toml file per domain, no central config edits
  • โ™ป๏ธ Validated hot config reload (--watch / FLASHLIN_WATCH=1) โ€” no dropped connections
  • ๐Ÿงน In-container cache purge via flashlin purge cache (loopback HTTP, works through docker exec)
  • ๐Ÿณ Four ready-made Compose modes: static HTTP, static HTTPS, PHP HTTP, PHP HTTPS
โ ๐Ÿ†• New in 2.0

Everything below is new since the 0.4.x image and wasn't in earlier Docker builds:

FeatureNotes
HTTP/3 over QUICOptional listener, image built with --features http3. Experimental โ€” see HTTP/3โ 
Automatic HTTPS (ACME)Image built with --features acme. Requests and renews Let's Encrypt certificates itself
WebSocket proxyHTTP/1 upgrade tunnels forwarded to your backend through proxy_pass
Reverse proxy failoverRound-robin upstream groups with passive failure cooldown
Validated hot reload--watch / FLASHLIN_WATCH=1 applies a fully validated config snapshot with no dropped connections
Streaming, byte ranges, precompressed assets64 KiB streamed reads, single/suffix ranges, If-Range
In-container cache purgeflashlin purge cache via docker exec โ€” see Useful commandsโ 
Per-virtual-host cache & rate-limit stateEach domain's .toml gets independent cache and rate-limit tracking

โ Repository overview

dockerflashlin/ is one part of the main flashlinโ  repository โ€” the Rust source itself, not a separate project:

flashlin/
โ”œโ”€โ”€ src/                      # Rust source
โ”‚   โ”œโ”€โ”€ main.rs                 # Entry point, config loading, banner
โ”‚   โ”œโ”€โ”€ server/                  # TCP listener, worker pool, graceful shutdown
โ”‚   โ”œโ”€โ”€ http/                    # Request parsing, response helpers, router
โ”‚   โ”œโ”€โ”€ config/                  # TOML parser + validator
โ”‚   โ”œโ”€โ”€ cache/                   # In-memory response cache (DashMap + TTL)
โ”‚   โ”œโ”€โ”€ static_files/            # File serving, ETag, cache headers, path security
โ”‚   โ”œโ”€โ”€ php/                     # PHP-FPM + FastCGI protocol implementation
โ”‚   โ”œโ”€โ”€ proxy/                   # Reverse proxy + upstream management
โ”‚   โ”œโ”€โ”€ tls/                     # rustls config + certificate loader
โ”‚   โ”œโ”€โ”€ security/                # Rate limiter, IP ACL, security headers
โ”‚   โ”œโ”€โ”€ middleware/               # Compression, request-ID, access logging
โ”‚   โ”œโ”€โ”€ metrics/                  # Prometheus counters + exposition
โ”‚   โ””โ”€โ”€ tests/                     # Integration tests
โ”œโ”€โ”€ server.toml                # Full configuration reference
โ”œโ”€โ”€ domains/                   # Example virtual host configs
โ”œโ”€โ”€ examples/                  # Example configs (HTTP/3, ACME, performance, โ€ฆ)
โ”œโ”€โ”€ docs/                      # HTTP_PROTOCOLS.md, PRODUCTION.md, PERFORMANCE.md, โ€ฆ
โ”œโ”€โ”€ production/                # Self-contained per-distro deploy packages
โ”‚   โ”œโ”€โ”€ centos/  debian/  raspberry-pi/  universal/
โ”‚   โ””โ”€โ”€ install.sh, install_linux_cdn.sh, systemd unit, โ€ฆ
โ”œโ”€โ”€ dockerflashlin/            # โ† you are here โ€” Docker & Compose setup
โ”‚   โ”œโ”€โ”€ Dockerfile, Dockerfile.prebuilt
โ”‚   โ”œโ”€โ”€ docker-compose*.yml
โ”‚   โ”œโ”€โ”€ config/, certs/, public/
โ”‚   โ””โ”€โ”€ README.md (this file)
โ””โ”€โ”€ .github/workflows/         # CI โ€” tests, and build + publish this Docker image

Building the image (below) needs the repository root as its build context, not this folder โ€” the Dockerfile compiles src/ directly. Everything else on this page (Compose files, TLS certs, config mounts) only touches files inside dockerflashlin/ itself.


โ Docker image

docker pull endurasolution/flashlin:2.0.0

Also available as endurasolution/flashlin:2.0 and endurasolution/flashlin:latest. Pin to the full 2.0.0 tag for anything you deploy โ€” latest will move. Currently published for linux/amd64.


โ Highlights

FeatureStatus
Rust web server (Tokio + Hyper)Yes
HTTP/1.1 + HTTP/2Yes
HTTP/3 over QUICOptional listener โ€” see HTTP/3โ 
Automatic HTTPS (Let's Encrypt / ACME)Yes โ€” built with acme feature
Manual TLS certificatesYes โ€” rustls, no OpenSSL
PHP-FPM / FastCGIYes
Reverse proxy + WebSocket upgradesYes
Gzip + Brotli compressionYes
ETag / Last-Modified / 304 cachingYes
Security headers + rate limitingYes
Prometheus metrics (loopback-only)Yes
In-container cache purgeYes โ€” flashlin purge cache
Docker Compose modes (HTTP/TLS/PHP)Yes

โ Directory structure

dockerflashlin/
โ”œโ”€โ”€ Dockerfile                  # Multi-stage build from source (default)
โ”œโ”€โ”€ Dockerfile.prebuilt         # Installs the released binary via install_linux.sh
โ”œโ”€โ”€ docker-compose.yml          # HTTP on port 80
โ”œโ”€โ”€ docker-compose.tls.yml      # HTTPS on 443 + HTTP 80โ†’443 redirect
โ”œโ”€โ”€ docker-compose.php.yml      # PHP-FPM + HTTP port 80
โ”œโ”€โ”€ docker-compose.php.tls.yml  # PHP-FPM + HTTPS port 443
โ”œโ”€โ”€ entrypoint.sh
โ”œโ”€โ”€ config/
โ”‚   โ”œโ”€โ”€ server.toml             # HTTP, port 80
โ”‚   โ”œโ”€โ”€ server.tls.toml         # HTTPS, port 443
โ”‚   โ”œโ”€โ”€ server.php.toml         # PHP-FPM + HTTP
โ”‚   โ””โ”€โ”€ server.php.tls.toml     # PHP-FPM + HTTPS
โ”œโ”€โ”€ certs/                      # Mount your TLS certs here
โ””โ”€โ”€ public/
    โ”œโ”€โ”€ index.html               # Example static page
    โ””โ”€โ”€ index.php                # Example PHP page

โ Quick start

โ Plain docker run
docker run -d --name flashlin -p 80:80 endurasolution/flashlin:2.0.0

Open http://localhost. Then:

docker logs -f flashlin      # tail logs
docker stop flashlin         # stop
docker rm flashlin           # remove
โ With Docker Compose
cd dockerflashlin
docker compose up -d              # HTTP, port 80
docker compose logs -f flashlin
docker compose down

โ Compose modes

ModeCompose filePortsPHPTLS
Static HTTPdocker-compose.yml80NoNo
Static HTTPSdocker-compose.tls.yml80, 443NoYes
PHP HTTPdocker-compose.php.yml80YesNo
PHP HTTPSdocker-compose.php.tls.yml80, 443YesYes

docker-compose.yml โ€” static HTTP:

services:
  flashlin:
    image: endurasolution/flashlin:2.0.0
    container_name: flashlin
    restart: unless-stopped
    ports:
      - "80:80"
    volumes:
      - ./public:/var/www/html:ro
      - ./config/server.toml:/etc/flashlin/server.toml:ro
      - flashlin_logs:/var/log/flashlin
    environment:
      RUST_LOG: info
      FLASHLIN_CONFIG: /etc/flashlin/server.toml

volumes:
  flashlin_logs:

The tls and php variants follow the same shape โ€” swap the config file mounted at /etc/flashlin/server.toml, add 443:443 for TLS, and add the php-fpm service for PHP (see PHP-FPMโ  below).


โ TLS / HTTPS setup

FlashLin expects certificates mounted at:

dockerflashlin/certs/
โ”œโ”€โ”€ fullchain.pem    # certificate + intermediate chain
โ””โ”€โ”€ privkey.pem      # private key
# On the host:
certbot certonly --standalone -d yourdomain.com

mkdir -p certs
cp /etc/letsencrypt/live/yourdomain.com/fullchain.pem certs/
cp /etc/letsencrypt/live/yourdomain.com/privkey.pem   certs/
โ Option B โ€” self-signed (local / dev only)
mkdir -p certs
openssl req -x509 -newkey rsa:4096 -sha256 -days 365 -nodes \
  -keyout certs/privkey.pem \
  -out    certs/fullchain.pem \
  -subj   "/CN=localhost"
โ Start with TLS
docker compose -f docker-compose.tls.yml up -d

FlashLin listens on 443 for HTTPS and 80 for HTTP, redirecting all HTTP traffic to HTTPS.

โ Renewing Let's Encrypt certificates
certbot renew
cp /etc/letsencrypt/live/yourdomain.com/fullchain.pem certs/
cp /etc/letsencrypt/live/yourdomain.com/privkey.pem   certs/
docker compose -f docker-compose.tls.yml restart flashlin

Prefer not managing certbot yourself? Build with the acme feature (already on for the published image) and let FlashLin request and renew Let's Encrypt certificates itself โ€” see Domain configuration and HTTPSโ .


โ HTTP/3 (QUIC) โ€” optional, experimental

The published image is built with acme,http3. After TLS is configured, enable it in the mounted server.toml:

[http3]
enabled = true
port = 443
max_concurrent_streams = 32

Add "443:443/udp" to the service's ports list alongside the existing TCP mapping, and allow UDP 443 through your host firewall. HTTP/1.1 and HTTP/2 continue to work over TCP 443 unaffected. This listener is explicitly experimental โ€” see HTTP/1.1, HTTP/2 and HTTP/3โ  for current limits.


โ Building the image

โ From source (default)

Build context is the flashlin project root, not dockerflashlin/:

# From the project root:
docker build -f dockerflashlin/Dockerfile -t flashlin .

# Or let Compose handle it:
cd dockerflashlin && docker compose build
โ Pre-built binary via the official install script

Build context is dockerflashlin/ itself:

cd dockerflashlin
docker build -f Dockerfile.prebuilt -t flashlin .

โ Configuration

โ Config files
Config filePortTLSPHP
server.toml80NoNo
server.tls.toml443YesNo
server.php.toml80NoYes
server.php.tls.toml443YesYes
โ Environment variables
VariableDefaultDescription
WEBROOT./publicHost directory mounted as the webroot (Compose only)
RUST_LOGinfoLog level: error, warn, info, debug, trace
FLASHLIN_CONFIG/etc/flashlin/server.tomlConfig path inside the container
FLASHLIN_WATCHunsetSet to 1 to hot-reload config on change instead of a static start
โ Custom webroot
WEBROOT=/srv/mysite docker compose -f docker-compose.tls.yml up -d
โ Mount everything explicitly
docker run -d \
  --name flashlin \
  -p 80:80 -p 443:443 \
  -v /path/to/server.toml:/etc/flashlin/server.toml:ro \
  -v /path/to/site:/var/www/html:ro \
  -v /path/to/certs:/etc/flashlin/certs:ro \
  endurasolution/flashlin:2.0.0
โ Container paths
Host pathContainer path
./public//var/www/html/
./config/server*.toml/etc/flashlin/server.toml
./certs//etc/flashlin/certs/
(named volume)/var/log/flashlin/

โ PHP-FPM

The PHP Compose files run two services:

ServiceImageRole
flashlinbuilt from source / endurasolution/flashlinHTTP/HTTPS server + FastCGI client
php-fpmphp:8.2-fpm-alpinePHP execution engine

Both mount the same webroot. FlashLin forwards .php requests to php-fpm:9000.

Adding PHP extensions (e.g. pdo_mysql):

# docker-compose.php.tls.yml
  php-fpm:
    build:
      context: .
      dockerfile_inline: |
        FROM php:8.2-fpm-alpine
        RUN docker-php-ext-install pdo pdo_mysql
docker compose -f docker-compose.php.yml build
docker compose -f docker-compose.php.yml up -d

โ Useful commands

# Logs
docker compose logs -f flashlin

# Restart (picks up new certs or a changed config)
docker compose -f docker-compose.tls.yml restart flashlin

# Shell inside the container
docker compose exec flashlin sh

# Clear the running server's in-memory response cache
# (loopback-only โ€” must run inside the container's network namespace)
docker exec flashlin flashlin purge cache

# Check config without starting a listener
docker exec flashlin flashlin --check /etc/flashlin/server.toml

# Stop everything
docker compose down

# Stop and remove volumes too
docker compose down -v

# Update to a newer image
docker pull endurasolution/flashlin:2.0.0
docker compose down && docker compose up -d

flashlin start/stop/restart aren't listed above โ€” those wrap systemctl for a systemd-managed install and don't apply inside a container. Use the docker/docker compose commands above instead; purge cache and --check work fine via docker exec since they only talk to the FlashLin process itself.


โ Production checklist

  • Use real Let's Encrypt certificates โ€” never self-signed in production
  • Set WEBROOT (or the volume mount) to your actual site directory
  • Remove the demo public/index.php
  • Pin the PHP image to a specific version, e.g. php:8.2.27-fpm-alpine
  • Set restart: always instead of unless-stopped
  • Set json = true under [logging] for structured log ingestion
  • Review [security.rate_limit] for your expected traffic
  • Automate certificate renewal (a cron job/systemd timer, or FlashLin's own ACME client)
  • Pin the image tag (2.0.0) rather than tracking latest
  • Back up mounted config and certs outside the container

ResourceLink
Websiteflashlin.comโ 
Documentationflashlin.com/docsโ 
GitHubgithub.com/endurasolution/flashlinโ 
Docker Hubhub.docker.com/r/endurasolution/flashlinโ 
One-line installer (non-Docker)curl -fsSL https://flashlin.com/install_linux.sh | bash

โ License

FlashLin is licensed under Creative Commons Attribution-NonCommercial 4.0 International (CC BY-NC 4.0). Free to use, share, and adapt for non-commercial purposes with attribution โ€” commercial use requires written permission. Full license: https://creativecommons.org/licenses/by-nc/4.0/โ .

Tag summary

Content type

Image

Digest

sha256:734eaeb8bโ€ฆ

Size

36 MB

Last updated

about 19 hours ago

docker pull endurasolution/flashlin