Skip to content
This repository has been archived by the owner on Dec 22, 2020. It is now read-only.
/ docker-caddy-proxy Public archive

Automated proxy solution for development and production using caddy.

License

Notifications You must be signed in to change notification settings

jshmrtn/docker-caddy-proxy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

caddy-proxy

Automated caddy proxy for Docker containers using docker-gen. Launching and stopping containers will automatically updated the proxy.

Versioning

Since this Docker image is intended to serve as an enhanced version of caddy, the versioning of this project will be tied directly to the corresponding caddy version.

Prerequisites

  • Docker socket must be mounted (read only is sufficient) so docker-gen works.

Usage

Proxy

All containers started with an env var VIRTUAL_HOST will be automatically proxied.:

$ docker run -e VIRTUAL_HOST=subdomain.example.com  ...

Basic Auth

To protect any container with HTTP Basic Authentication add a BASIC_AUTH env var path (i.e. /), username, and password:

$ docker run -e VIRTUAL_HOST=subdomain.example.com -e BASIC_AUTH="/ myname mysecrect" ...

Caddy options

You can pass in caddy run arguments inside the env var CADDY_OPTIONS.

$ docker run -e VIRTUAL_HOST=subdomain.example.com -e CADDY_OPTIONS="--email webmaster@example.com" ...

Running

Then to run it:

$ docker run -v /var/run/docker.sock:/tmp/docker.sock:ro -v /srv/caddy/.caddy:/root/.caddy --name caddy-proxy -p 80:80 -p 443:443 -e CADDY_OPTIONS="--email webmaster@example.com" -d jshmrtn/caddy-proxy:0.2.1

About

Automated proxy solution for development and production using caddy.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published