All Projects → abiosoft → Caddy Docker

abiosoft / Caddy Docker

Licence: mit
Docker container for Caddy

Programming Languages

go
31211 projects - #10 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to Caddy Docker

Huddy
Huddy = Hugo + Caddy docker container
Stars: ✭ 14 (-98.08%)
Mutual labels:  container, caddy
Docker
Directus Docker — The Official Docker Container for the Directus Suite
Stars: ✭ 93 (-87.24%)
Mutual labels:  container, webserver
Httperrorpages
⏩ Simple HTTP Error Page Generator
Stars: ✭ 772 (+5.9%)
Mutual labels:  webserver, caddy
caddy-esi
Middleware for Caddy Server integrating ESI (edge side includes) tags with parallel loading. Able to connect to HTTP/S/2, Memcache, Redis, shell scripts, gRPC and SQL backends 🐜🐜🐜
Stars: ✭ 28 (-96.16%)
Mutual labels:  webserver, caddy
Docker Atlassian Jira
Atlassian JIRA Core wrapped in a Docker image
Stars: ✭ 553 (-24.14%)
Mutual labels:  container
Seqbox
A single file container/archive that can be reconstructed even after total loss of file system structures
Stars: ✭ 480 (-34.16%)
Mutual labels:  container
Kraken
P2P Docker registry capable of distributing TBs of data in seconds
Stars: ✭ 4,849 (+565.16%)
Mutual labels:  container
Polaris
A cross-platform, minimalist web framework for PowerShell
Stars: ✭ 464 (-36.35%)
Mutual labels:  webserver
Docker Alpine Java
Oracle Java8 over AlpineLinux with glibc 2.29
Stars: ✭ 703 (-3.57%)
Mutual labels:  container
Ansible Role Nginx
Ansible Role - Nginx
Stars: ✭ 632 (-13.31%)
Mutual labels:  webserver
Martin
Blazing fast and lightweight PostGIS vector tiles server
Stars: ✭ 540 (-25.93%)
Mutual labels:  webserver
Dotnet Serve
Simple command-line HTTPS server for the .NET Core CLI
Stars: ✭ 481 (-34.02%)
Mutual labels:  webserver
Docker Php Nginx
Docker image with Nginx 1.18 & PHP-FPM 7.4 on Alpine Linux
Stars: ✭ 581 (-20.3%)
Mutual labels:  container
Wsgidav
A generic and extendable WebDAV server based on WSGI
Stars: ✭ 476 (-34.71%)
Mutual labels:  webserver
Robin Hood Hashing
Fast & memory efficient hashtable based on robin hood hashing for C++11/14/17/20
Stars: ✭ 658 (-9.74%)
Mutual labels:  container
Telegraph
Secure Web Server for iOS, tvOS and macOS
Stars: ✭ 474 (-34.98%)
Mutual labels:  webserver
Nexclipper
Metrics Pipeline for interoperability and Enterprise Prometheus
Stars: ✭ 533 (-26.89%)
Mutual labels:  container
Hunchentoot
Web server written in Common Lisp
Stars: ✭ 589 (-19.2%)
Mutual labels:  webserver
Cyberpanel
Cyber Panel - The hosting control panel for OpenLiteSpeed
Stars: ✭ 521 (-28.53%)
Mutual labels:  webserver
Liman
Self-hosted web application for monitoring docker.
Stars: ✭ 518 (-28.94%)
Mutual labels:  container

caddy

A Docker image for Caddy. This image includes git, cors, realip, expires, cache and cloudflare plugins.

Plugins can be configured via the plugins build arg.

Check abiosoft/caddy:builder for generating cross-platform Caddy binaries.

License

This image is built from source code. As such, it is subject to the project's Apache 2.0 license, but it neither contains nor is subject to the EULA for Caddy's official binary distributions.

Let's Encrypt Subscriber Agreement

Caddy may prompt to agree to Let's Encrypt Subscriber Agreement. This is configurable with ACME_AGREE environment variable. Set it to true to agree. ACME_AGREE=true.

Telemetry Stats

Starting from v0.11.0, Telemetry stats are submitted to Caddy by default. To use Caddy without telemetry, use the :no-stats or :<version>-no-stats tags. e.g. :0.11.0-no-stats, :0.11.0-php-no-stats.

Getting Started

$ docker run -d -p 2015:2015 abiosoft/caddy

Point your browser to http://127.0.0.1:2015.

Be aware! If you don't bind mount the location certificates are saved to, you may hit Let's Encrypt rate limits rending further certificate generation or renewal disallowed (for a fixed period)! See "Saving Certificates" below!

Saving Certificates

Save certificates on host machine to prevent regeneration every time container starts. Let's Encrypt has rate limit.

$ docker run -d \
    -v $(pwd)/Caddyfile:/etc/Caddyfile \
    -v $HOME/.caddy:/root/.caddy \
    -p 80:80 -p 443:443 \
    abiosoft/caddy

Here, /root/.caddy is the location inside the container where caddy will save certificates.

Additionally, you can use an environment variable to define the exact location caddy should save generated certificates:

$ docker run -d \
    -e "CADDYPATH=/etc/caddycerts" \
    -v $HOME/.caddy:/etc/caddycerts \
    -p 80:80 -p 443:443 \
    abiosoft/caddy

Above, we utilize the CADDYPATH environment variable to define a different location inside the container for certificates to be stored. This is probably the safest option as it ensures any future docker image changes don't interfere with your ability to save certificates!

PHP

:[<version>-]php variant of this image bundles PHP-FPM alongside essential php extensions and composer. e.g. :php, :0.10.14-php

$ docker run -d -p 2015:2015 abiosoft/caddy:php

Point your browser to http://127.0.0.1:2015 and you will see a php info page.

Local php source

Replace /path/to/php/src with your php sources directory.

$ docker run -d -v /path/to/php/src:/srv -p 2015:2015 abiosoft/caddy:php

Point your browser to http://127.0.0.1:2015.

Note

Your Caddyfile must include the line on startup php-fpm7. For Caddy to be PID 1 in the container, php-fpm7 could not be started.

Using git sources

Caddy can serve sites from git repository using git plugin.

Create Caddyfile

Replace github.com/abiosoft/webtest with your repository.

$ printf "0.0.0.0\nroot src\ngit github.com/abiosoft/webtest" > Caddyfile
Run the image
$ docker run -d -v $(pwd)/Caddyfile:/etc/Caddyfile -p 2015:2015 abiosoft/caddy

Point your browser to http://127.0.0.1:2015.

Custom plugins

You can build a docker image with custom plugins by specifying plugins build arg as shown in the example below.

docker build --build-arg \
    plugins=git,linode \
    github.com/abiosoft/caddy-docker.git

Usage

Default Caddyfile

The image contains a default Caddyfile.

0.0.0.0
browse
fastcgi / 127.0.0.1:9000 php # php variant only
on startup php-fpm7 # php variant only

The last 2 lines are only present in the php variant.

Paths in container

Caddyfile: /etc/Caddyfile

Sites root: /srv

Using local Caddyfile and sites root

Replace /path/to/Caddyfile and /path/to/sites/root accordingly.

$ docker run -d \
    -v /path/to/sites/root:/srv \
    -v path/to/Caddyfile:/etc/Caddyfile \
    -p 2015:2015 \
    abiosoft/caddy

Let's Encrypt Auto SSL

Note that this does not work on local environments.

Use a valid domain and add email to your Caddyfile to avoid prompt at runtime. Replace mydomain.com with your domain and [email protected] with your email.

mydomain.com
tls [email protected]
Run the image

You can change the the ports if ports 80 and 443 are not available on host. e.g. 81:80, 444:443

$ docker run -d \
    -v $(pwd)/Caddyfile:/etc/Caddyfile \
    -p 80:80 -p 443:443 \
    abiosoft/caddy
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].