mirror of
https://github.com/teddysun/across.git
synced 2025-01-19 06:19:35 +08:00
Caddy Docker Image by Teddysun
Caddy is a powerful, enterprise-ready, open source web server with automatic HTTPS written in Go.
Docker images are built for quick deployment in various computing cloud providers.
For more information on docker and containerization technologies, refer to official document.
Prepare the host
If you need to install docker by yourself, follow the official installation guide.
Pull the image
$ docker pull teddysun/caddy
This pulls the version v1.0.5 of Caddy.
It can be found at Docker Hub.
Start a container
You must create a configuration file /etc/caddy/Caddyfile
in host at first:
$ mkdir -p /etc/caddy
Mount your site root using the www
volume, a sample Caddyfile
like below:
:80 {
root /www
index index.html
}
There is an example to override the default Caddyfile
, you can mount a new one at /etc/caddy/Caddyfile
like below:
$ docker run -d -p 80:80 --name caddy --restart=always -v /etc/caddy:/etc/caddy -v $(pwd)/site:/www teddysun/caddy