ZZROTDesign/alpine-caddy
Fork: 35 Star: 105 (更新于 2024-11-20 04:14:51)
license: MIT
Language: Shell .
Alpine Linux Docker Container running Caddyserver
最后发布版本: v0.9.5 ( 2017-01-26 07:32:39)
Caddy Server on Alpine Linux
This is a Docker image for Caddyserver. This image runs with a base of Alpine-Linux making it extremely small, secure and fast.
This image can also be found on Docker Hub.
Usage
We recommend using our images in conjunction with Docker-Compose. This allows for easier creation of containers with the proper volumes and ports enabled.
We have included an example docker-compose file for use in a real project.
This image works with two defaults
- A default Caddyfile
- A default location inside the container for static files: /var/www/html
In order to use this image, we recommend running it with a volume connecting your static files to the root location of the docker file:
docker run -d -p 80:80 -v $(pwd)/public:/var/www/html zzrot/alpine-caddy
The server will be available at your.docker.machine.ip.
This is the bare minimum needed to use this image. Although further customization is made easier with a docker-compose file.
The benefits of building an image with a overrideable Caddyfile are that you can include your own by including another volume. To see a fully configured docker-compose file see this example.
For writing a custom Caddyfile please read this.
Middleware
Alpine-Caddy includes all Caddy Middleware and features. You can read more on these specific features in the Caddy User Guide.
Caddy as a reverse proxy
This image can also effectively be used as a reverse proxy. Included in the examples/ folder is an example Caddyfile.
The example docker-compose shows how to include your custom Caddyfile as a volume as well as an example proxy set up with containers.
Volumes
Alpine-Caddy has three locations where volumes can be linked to.
Static Files
In order to serve static content, alpine-caddy needs to be able to access your static files from inside of the container. To do this, link the directory of your static files with /var/www/html inside of the container.
For docker-compose.yml files, under the volumes declaration, include:
- ./public:/var/www/html
or
docker run -v $(pwd)/public:/var/www/html
Custom Caddyfile
To upload a custom Caddyfile, link your Caddyfile to the directory /etc/Caddyfile in the container. For docker-compose.yml files, under the volumes declaration, include:
- ./Caddyfile:/etc/Caddyfile
or
docker run -v $(pwd)/Caddyfile:/etc/Caddyfile zzrot/alpine-caddy
Certificate Persistance
If you use alpine-caddy to generate SSL certificates from Let's Encrypt, you should persist those certificates outside of the container. In the instance of a container failure, this allows the container to reuse the same certificates, instead of generating new ones from Let's Encrypt.
For information on including this into your Caddyfile see the Caddyfile tls specification.
The certificates are stored in /root/.caddy inside of the container, and thus you must connect an outside directory to that directory to allow persistance. For docker-compose.yml files, under the volumes declaration, include:
- ./.caddy:/root/.caddy
or
docker run -v $(pwd)/.caddy:/root/.caddy
Contributing to Alpine-Caddy
Team members
Don't hesitate to get in contact with either one of us with problems, questions, etc.
Adding new features
- Fork it!
- Create your feature branch: git checkout -b my-new-feature
- Commit your changes: git commit -am 'Add some feature'
- Push to the branch: git push origin my-new-feature
- Submit a pull request :D
Don’t get discouraged! We estimate that the response time from the maintainers is around: 24 hours.
Reporting Security Issues
If you discover a security issue in this Docker image, please report it by sending an email to docker@zzrot.com
This will allow us to assess the risk, and make a fix available before we add a bug report to the GitHub repository.
Thanks for helping make this image safe for everyone!
License
The code is available under the MIT License.
最近版本更新:(数据更新于 2024-08-29 18:50:20)
2017-01-26 07:32:39 v0.9.5
2016-12-24 03:55:39 v0.9.4
2016-09-30 22:42:47 v0.9.3
2016-08-20 05:36:14 v0.9.1
2016-08-18 22:43:02 v0.9
ZZROTDesign/alpine-caddy同语言 Shell最近更新仓库
2024-11-22 20:01:25 morytyann/OpenWrt-mihomo
2024-11-19 12:59:33 RROrg/rr
2024-11-13 11:38:52 dockur/windows
2024-11-13 07:21:02 j-hc/revanced-magisk-module
2024-11-05 08:14:05 kevin01523/WSA-MagiskDelta
2024-11-01 20:30:51 DoL-Lyra/Lyra