{"id":13435791,"url":"https://github.com/abiosoft/caddy-docker","last_synced_at":"2025-05-16T15:07:49.496Z","repository":{"id":32935526,"uuid":"36531504","full_name":"abiosoft/caddy-docker","owner":"abiosoft","description":"Docker container for Caddy","archived":false,"fork":false,"pushed_at":"2021-12-21T20:13:17.000Z","size":134,"stargazers_count":774,"open_issues_count":64,"forks_count":313,"subscribers_count":18,"default_branch":"master","last_synced_at":"2025-04-12T14:16:05.226Z","etag":null,"topics":["caddy","container","docker","go","php","webserver"],"latest_commit_sha":null,"homepage":"https://hub.docker.com/r/abiosoft/caddy/","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"PartTimeLegend/BitcoinBrainWalletSweeper","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/abiosoft.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-05-29T22:04:18.000Z","updated_at":"2025-04-09T00:04:29.000Z","dependencies_parsed_at":"2022-08-07T18:30:11.111Z","dependency_job_id":null,"html_url":"https://github.com/abiosoft/caddy-docker","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abiosoft%2Fcaddy-docker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abiosoft%2Fcaddy-docker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abiosoft%2Fcaddy-docker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abiosoft%2Fcaddy-docker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/abiosoft","download_url":"https://codeload.github.com/abiosoft/caddy-docker/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254553958,"owners_count":22090417,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["caddy","container","docker","go","php","webserver"],"created_at":"2024-07-31T03:00:39.264Z","updated_at":"2025-05-16T15:07:44.488Z","avatar_url":"https://github.com/abiosoft.png","language":"Shell","funding_links":[],"categories":["HarmonyOS","Shell","go","Shell (473)","Repositories"],"sub_categories":["Windows Manager"],"readme":"# caddy\n\nA [Docker](https://docker.com) image for [Caddy](https://caddyserver.com). This image includes [git](https://caddyserver.com/docs/http.git), [cors](https://caddyserver.com/docs/http.cors), [realip](https://caddyserver.com/docs/http.realip), [expires](https://caddyserver.com/docs/http.expires), [cache](https://caddyserver.com/docs/http.cache) and [cloudflare](https://caddyserver.com/docs/tls.dns.cloudflare) plugins.\n\nPlugins can be configured via the [`plugins` build arg](#custom-plugins).\n\n[![](https://images.microbadger.com/badges/image/abiosoft/caddy.svg)](https://microbadger.com/images/abiosoft/caddy \"Get your own image badge on microbadger.com\")\n[![](https://img.shields.io/badge/version-1.0.3-blue.svg)](https://github.com/caddyserver/caddy/tree/v1.0.3)\n\nCheck [abiosoft/caddy:builder](https://github.com/abiosoft/caddy-docker/blob/master/BUILDER.md) for generating cross-platform Caddy binaries.\n\n### License\n\nThis image is built from [source code](https://github.com/caddyserver/caddy). As such, it is subject to the project's [Apache 2.0 license](https://github.com/caddyserver/caddy/blob/baf6db5b570e36ea2fee30d50f879255a5895370/LICENSE.txt), but it neither contains nor is subject to [the EULA for Caddy's official binary distributions](https://github.com/caddyserver/caddy/blob/545fa844bbd188c1e5bff6926e5c410e695571a0/dist/EULA.txt).\n\n### Let's Encrypt Subscriber Agreement\n\nCaddy may prompt to agree to [Let's Encrypt Subscriber Agreement](https://letsencrypt.org/documents/2017.11.15-LE-SA-v1.2.pdf). This is configurable with `ACME_AGREE` environment variable. Set it to true to agree. `ACME_AGREE=true`.\n\n### Telemetry Stats\n\nStarting from `v0.11.0`, [Telemetry stats](https://caddyserver.com/docs/telemetry) are submitted to Caddy by default. To use Caddy without telemetry, use the `:no-stats` or `:\u003cversion\u003e-no-stats` tags. e.g. `:0.11.0-no-stats`, `:0.11.0-php-no-stats`.\n\n## Getting Started\n\n```sh\n$ docker run -d -p 2015:2015 abiosoft/caddy\n```\n\nPoint your browser to `http://127.0.0.1:2015`.\n\n\u003e Be aware! If you don't bind mount the location certificates are saved to, you may hit Let's Encrypt rate [limits](https://letsencrypt.org/docs/rate-limits/) rending further certificate generation or renewal disallowed (for a fixed period)! See \"Saving Certificates\" below!\n\n### Saving Certificates\n\nSave certificates on host machine to prevent regeneration every time container starts.\nLet's Encrypt has [rate limit](https://community.letsencrypt.org/t/rate-limits-for-lets-encrypt/6769).\n\n```sh\n$ docker run -d \\\n    -v $(pwd)/Caddyfile:/etc/Caddyfile \\\n    -v $HOME/.caddy:/root/.caddy \\\n    -p 80:80 -p 443:443 \\\n    abiosoft/caddy\n```\n\nHere, `/root/.caddy` is the location _inside_ the container where caddy will save certificates.\n\nAdditionally, you can use an _environment variable_ to define the exact location caddy should save generated certificates:\n\n```sh\n$ docker run -d \\\n    -e \"CADDYPATH=/etc/caddycerts\" \\\n    -v $HOME/.caddy:/etc/caddycerts \\\n    -p 80:80 -p 443:443 \\\n    abiosoft/caddy\n```\n\nAbove, we utilize the `CADDYPATH` environment variable to define a different location inside the container for\ncertificates 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!\n\n### PHP\n\n`:[\u003cversion\u003e-]php` variant of this image bundles PHP-FPM alongside essential php extensions and [composer](https://getcomposer.org). e.g. `:php`, `:0.10.14-php`\n\n```sh\n$ docker run -d -p 2015:2015 abiosoft/caddy:php\n```\n\nPoint your browser to `http://127.0.0.1:2015` and you will see a php info page.\n\n##### Local php source\n\nReplace `/path/to/php/src` with your php sources directory.\n\n```sh\n$ docker run -d -v /path/to/php/src:/srv -p 2015:2015 abiosoft/caddy:php\n```\n\nPoint your browser to `http://127.0.0.1:2015`.\n\n##### Note\n\nYour `Caddyfile` must include the line `on startup php-fpm7`. For Caddy to be PID 1 in the container, php-fpm7 could not be started.\n\n### Using git sources\n\nCaddy can serve sites from git repository using [git](https://caddyserver.com/docs/http.git) plugin.\n\n##### Create Caddyfile\n\nReplace `github.com/abiosoft/webtest` with your repository.\n\n```sh\n$ printf \"0.0.0.0\\nroot src\\ngit github.com/abiosoft/webtest\" \u003e Caddyfile\n```\n\n##### Run the image\n\n```sh\n$ docker run -d -v $(pwd)/Caddyfile:/etc/Caddyfile -p 2015:2015 abiosoft/caddy\n```\n\nPoint your browser to `http://127.0.0.1:2015`.\n\n## Custom plugins\n\nYou can build a docker image with custom plugins by specifying `plugins` build arg as shown in the example below.\n\n```\ndocker build --build-arg \\\n    plugins=git,linode \\\n    github.com/abiosoft/caddy-docker.git\n```\n\n## Usage\n\n#### Default Caddyfile\n\nThe image contains a default Caddyfile.\n\n```\n0.0.0.0\nbrowse\nfastcgi / 127.0.0.1:9000 php # php variant only\non startup php-fpm7 # php variant only\n```\n\nThe last 2 lines are only present in the php variant.\n\n#### Paths in container\n\nCaddyfile: `/etc/Caddyfile`\n\nSites root: `/srv`\n\n#### Using local Caddyfile and sites root\n\nReplace `/path/to/Caddyfile` and `/path/to/sites/root` accordingly.\n\n```sh\n$ docker run -d \\\n    -v /path/to/sites/root:/srv \\\n    -v path/to/Caddyfile:/etc/Caddyfile \\\n    -p 2015:2015 \\\n    abiosoft/caddy\n```\n\n### Let's Encrypt Auto SSL\n\n**Note** that this does not work on local environments.\n\nUse a valid domain and add email to your Caddyfile to avoid prompt at runtime.\nReplace `mydomain.com` with your domain and `user@host.com` with your email.\n\n```\nmydomain.com\ntls user@host.com\n```\n\n##### Run the image\n\nYou can change the the ports if ports 80 and 443 are not available on host. e.g. 81:80, 444:443\n\n```sh\n$ docker run -d \\\n    -v $(pwd)/Caddyfile:/etc/Caddyfile \\\n    -p 80:80 -p 443:443 \\\n    abiosoft/caddy\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabiosoft%2Fcaddy-docker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fabiosoft%2Fcaddy-docker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabiosoft%2Fcaddy-docker/lists"}