caeret / build-caddy-server

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

build-caddy-server

Turnkey solution for building Caddy web server as a static Linux binary on golang:1-alpine by yourself.

This should help you get started with using Caddy without relying on the pre-built binaries.

NOT TO BE CONFUSED with Docker images containing Caddy binary which you can docker run in a production environment.

Usage

$ docker pull nodakai/build-caddy-server
$ docker run -v $(pwd):/output nodakai/build-caddy-server
...
$ ls caddy
caddy*
$ file caddy
caddy: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, not stripped

Volumes

  • /output: Mount a directory to save the Caddy binary (e.g. $(pwd))

Environment Variables

  • VERSION: Specify which version of Caddy to checkout and build. The latest commit from master is used by default. E.g. you may want to use docker run -e VERSION=1.0.0 ... (this translates to go get .../caddy@1.0.0 under the hood)
  • TELEMETRY: Specify true or false depending on whether or not you want to enable the telemetry feature
  • PLUGINS: See below

Plugins

As an experimental feature, three plugins ratelimit, ipfilter, and prometheus are enabled by default. If you want to specify which plugins to enable, list their repo paths in the PLUGINS env var, delimited by commas (,). You can omit github.com/ if paths begin with it. E.g. docker run -e PLUGINS= ...)

Links

About

License:Mozilla Public License 2.0


Languages

Language:Shell 75.3%Language:Dockerfile 15.7%Language:Go 9.0%