Heavily inspired by wemake-services' awesome caddy-gen.
Use labels
.
The main idea is simple. Every labeled service exposes a virtual.host
to be handled. Then, every container represents a single reverse_proxy
's to
option to serve requests.
Options to configure:
virtual.host
domain name, don't passhttp://
orhttps://
, you can separate them with space,virtual.alias
domain alias, e.q.www
prefix,virtual.port
port exposed by container, e.g.3000
for React apps in development,virtual.tls-email
the email address to use for the ACME account managing the site's certificates,virtual.auth.username
andvirtual.auth.password
together provide HTTP basic authentication.
Password should be a string base64
encoded from bcrypt
hash. You can use https://bcrypt-generator.com/ with default config and https://www.base64encode.org/.
To backup certificates make a volume:
./caddy-info:/data/caddy