jpillora/caddy
Caddy in a docker container, configurable via a simple web UI
50K+
Caddy in a docker container, configurable via a simple web UI
Create a /opt/Caddyfile
file on the Docker host
# Caddy config, for a more information, see:
# https://caddyserver.com/docs/caddyfile
:80 {
gzip
log stdout
proxy / example.com
}
Run the container
$ docker run \
--name caddy \
-d \
-p 58080:8080 \
-p 80:80 -p 443:443 \
-v /opt/Caddyfile:/etc/Caddyfile \
-v /opt/caddy:/root/.caddy \
--log-opt "max-size=100m" \
-e "HTTP_USER=foo" \
-e "HTTP_PASS=bar" \
--restart always \
jpillora/caddy
Visit http://<docker-host-ip>:58080
, authenticate with foo/bar
and you should see
You now have an HTTP web server running at http://<your-hostname>
Using your DNS provider, create A record: <docker-host-ip>
to <your-hostname>
Change :80
to https://<your-hostname>:443
, and add a new line tls <your-email>
above the gzip
line, then Restart
You now have an HTTPS web server running at https://<your-hostname>
Extras
-p <internal-ip>:58080:8080
and then it might be safe to remove USER
/PASS
MIT License
Copyright © 2017 Jaime Pillora <dev@jpillora.com>
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
docker pull jpillora/caddy