Skip to content

Caddy Multi-Arch to serve http or https. Forked from abiosoft/caddy-docker to arm7 arm64 & amd64

License

Notifications You must be signed in to change notification settings

deftwork/caddy-docker

 
 

Repository files navigation

Caddy for linux arm7 arm64 & amd64

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)

Details

Docker Hub Docker Pulls Docker Stars Size/Layers
caddy-docker

dockeri.co

Latest Enhancements

  • Add support for PHP pages
  • Add support to arm64
  • Upgrade Caddy version to 1.0.0

Getting Started

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.

My Real Usage Example

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.

Let's Encrypt Auto SSL

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.

About

Caddy Multi-Arch to serve http or https. Forked from abiosoft/caddy-docker to arm7 arm64 & amd64

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Makefile 49.4%
  • Dockerfile 25.2%
  • PHP 13.8%
  • HTML 11.6%