{"id":24608009,"url":"https://github.com/joshix/caddybox","last_synced_at":"2026-03-06T06:18:02.093Z","repository":{"id":46795974,"uuid":"36561692","full_name":"joshix/caddybox","owner":"joshix","description":"Caddy web server container image","archived":false,"fork":false,"pushed_at":"2025-05-31T07:49:37.000Z","size":210087,"stargazers_count":34,"open_issues_count":0,"forks_count":8,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-05-31T19:15:42.790Z","etag":null,"topics":["docker","http","https","letsencrypt","tls","webserver"],"latest_commit_sha":null,"homepage":"https://quay.io/joshix/caddy","language":"Dockerfile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/joshix.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2015-05-30T14:36:54.000Z","updated_at":"2025-05-31T07:49:41.000Z","dependencies_parsed_at":"2023-01-20T16:47:30.166Z","dependency_job_id":"69b833d5-9914-4b6f-a753-4558ca8ea4ee","html_url":"https://github.com/joshix/caddybox","commit_stats":null,"previous_names":[],"tags_count":37,"template":false,"template_full_name":null,"purl":"pkg:github/joshix/caddybox","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joshix%2Fcaddybox","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joshix%2Fcaddybox/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joshix%2Fcaddybox/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joshix%2Fcaddybox/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/joshix","download_url":"https://codeload.github.com/joshix/caddybox/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joshix%2Fcaddybox/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30164539,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-06T04:43:31.446Z","status":"ssl_error","status_checked_at":"2026-03-06T04:40:30.133Z","response_time":250,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["docker","http","https","letsencrypt","tls","webserver"],"created_at":"2025-01-24T17:49:29.867Z","updated_at":"2026-03-06T06:18:02.056Z","avatar_url":"https://github.com/joshix.png","language":"Dockerfile","readme":"# Caddy container image\n\n[![Container Image on Quay](https://quay.io/repository/joshix/caddy/status \"Container Image on Quay\")][quay-joshix-caddy]\n\nThis container image encapsulates a [*Caddy*][caddy] HTTP server. It is built `FROM` the [*scratch* image][scratchimg] and executes a statically-linked `caddy` binary with no added [modules][caddons]. It includes a tiny `index.html` landing page so that it can be demonstrated without configuration on any container host by invoking e.g., `docker run -d -P quay.io/joshix/caddy`.\n\nBy default this caddy listens on the container's `EXPOSE`d TCP port #8080 and attempts to fulfill requests with files beneath the container's `/var/www/html/`.\n\nContent should be added by binding a host volume over that path, or by `COPY`ing/`ADD`ing files there when building an image `FROM` this one. Adding a `Caddyfile` through the same mechanisms allows configuration of the web server and sites as described in the [Caddy documentation][caddydocs].\n\n## Container File System\n\nThe caddy binary produced by the build stage and the file tree beneath `./rootfs/` are `COPY`'d to the container's `/`, resulting in this file hierarchy in the container image:\n\n* `/bin/caddy` - Server executable and container `ENTRYPOINT`\n* `/var/www/html/` - Caddy working directory and root of HTTP name space\n* `/var/www/html/Caddyfile` - Default configuration\n* `/var/www/html/index.html` - Default landing page\n\n## Adding Content\n\nThere are at least two ways to provide Caddy with content and configuration.\n\n* Bind a host file system path over the container's HTTP name space root:\n\n```sh\n$ ls site/html\n  index.html\n  [...]\n$ docker run -d -p 8080:8080 -v ./site:/var/www:ro quay.io/joshix/caddy\n```\n\nOR,\n\n* Build the files into an image based on this one:\n\n```sh\n$ cd site/html\n$ ls\n  Dockerfile\n  index.html\n  [...]\n$ cat Dockerfile\n  FROM quay.io/joshix/caddy\n  COPY . /var/www/html\n$ docker build -t \"com.mysite-caddy\" .\n$ docker run -d -p 8080:8080 com.mysite-caddy\n```\n\n## Configuration\n\nTo configure Caddy, add `Caddyfile` to the server's working directory:\n\n```sh\n$ ls site/html\n  Caddyfile\n  index.md\n  [...]\n$ cat site/html/Caddyfile\n  :8080 {\n    file_server {\n    }\n    log {\n      output stdout\n    }\n  }\n  [...]\n$ docker run -d -p 8080:8080 -v ./site:/var/www:ro quay.io/joshix/caddy\n```\n\n### Manual TLS\n\nTo serve HTTPS, add certificate and key files, with a Caddyfile naming them:\n\n```sh\n$ ls site\n  html/\n  tls/\n$ ls site/html\n  Caddyfile\n  index.html\n  [...]\n$ ls site/tls\n  site.crt\n  site.key\n$ cat site/html/Caddyfile\n  {\n    http_port 8080\n  }\n  :8443 {\n    tls ../tls/site.crt ../tls/site.key\n    file_server {\n    }\n    log {\n      output stdout\n    }\n  }\n  [...]\n$ docker run -d -p 8080:8080 -p 8443:8443 -v ./site:/var/www:ro quay.io/joshix/caddy\n```\n\n### Automatic *Let's Encrypt* TLS\n\nCaddy can [automatically acquire and renew TLS keys and certificates][caddyautotls] to secure connections using the *Let's Encrypt* project's ACME protocol. Because this container runs the `caddy` executable as an unprivileged user, it cannot bind privileged ports (port numbers \u003c 1024) without further arrangement. This container is intended for use behind a container network like that provided by Docker or the Kubernetes CNI. Usually TLS termination happens at the edge of the container host network rather than at the HTTPd.\n\n## Cloning this repo\n\nVersions up to v2.6.2-cb.1 included a caddy binary built outside the container build process. While that is no longer true, and caddy is built in a multi-stage container build, this repo remains large with every previous version having a binary at `rootfs/bin/caddy`.\n\nWork around this with git's shallow clone. This fetches only the given number of revisions. For most new clones of this repo, that number should be 1. Something like `git clone --depth 1 https://github.com/joshix/caddybox` should require only a small download and disk allocation.\n\n## Building Caddy with xcaddy\n\nPreserved for reference. The build is no longer done out-of-band and the caddy binary is no longer included in this container image source repo. Instead, the xcaddy build tool runs inside a first stage build container in a [multi-stage][multi-stage-build] [Dockerfile][Dockerfile].\n\n\u003chttps://github.com/caddyserver/xcaddy\u003e\n\n```sh\ncd /tmp/caddyboxbuild\nGOOS=linux GOARCH=amd64 xcaddy build v2.10.0\nfile caddy\ncp caddy [...]/caddybox/rootfs/bin/caddy\n```\n\n[caddons]: https://caddyserver.com/docs/modules/\n[caddy]: https://caddyserver.com\n[caddyautotls]: https://caddyserver.com/docs/automatic-https\n[caddydocs]: https://caddyserver.com/docs\n[Dockerfile]: Dockerfile\n[multi-stage-build]: https://docs.docker.com/build/building/multi-stage/\n[quay-joshix-caddy]: https://quay.io/repository/joshix/caddy\n[scratchimg]: https://hub.docker.com/_/scratch/\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoshix%2Fcaddybox","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjoshix%2Fcaddybox","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoshix%2Fcaddybox/lists"}