A Docker image for Caddy that will let you to serve http or https with Let's Encrypt certificate autogenerated. This image includes the git plugin. Plugins can be configured via the PLUGIN
file at build time. Forked from abiosoft/caddy-docker initially to provide an arm compatible container, now also compatible with amd64 architecture (thanks to its Multi-Arch base image)
Docker Hub | Docker Pulls | Docker Stars | Size/Layers |
---|---|---|---|
caddy-docker |
- Add support for PHP pages
- Add support to arm64
- Upgrade Caddy version to 1.0.0
This is a simple usage for testing proposes.
$ docker run -d -p 2015:2015 elswork/arm-caddy:latest
or
$ docker-compose up
If you want to serve PHP pages:
$ docker-compose -f docker-compose-php.yml up
Point your browser to http://127.0.0.1:2015
.
In order everyone could take full advantages of the usage of this docker container, I'll describe my own real usage setup.
$ docker run -d \
--name myarm-caddy \
-p 80:80 -p 443:443 \
-v /var/www/html:/srv \
-v $HOME/Caddyfile/https:/etc/Caddyfile \
-v $HOME/.caddy:/root/.caddy \
elswork/arm-caddy:latest
--name myarm-caddy
This is absolutely optional, it helps to me to easily identify and operate the container after the first execution.
$ docker start myarm-caddy
$ docker stop myarm-caddy
$ docker rm myarm-caddy
...
-p 80:80 -p 443:443
Caddy will serve https by default.
-v /var/www/html:/srv
/var/www/html is the local folder where I have the files to serve. I mount in the container folder that Caddy use to serve files.
-v $HOME/Caddyfile/https:/etc/Caddyfile
$HOME/Caddyfile/https is my Caddy configuration file.
mydomain.com, www.mydomain.com {
browse
gzip
log stdout
errors stdout
tls user@host.com
}
-v $HOME/.caddy:/root/.caddy
I mount the folder where I will store the Let's Encrypt certificates that will be generated automatically the first time the container run, in order to prevent regenerating them each time.
Note that this does not work on local environments.
You must use a valid domain properly configured to point your docker server and add email to your Caddyfile to avoid prompt at runtime.