Skip to content

Latest commit

 

History

History
63 lines (40 loc) · 2.36 KB

README.md

File metadata and controls

63 lines (40 loc) · 2.36 KB

caddy-docker-custom

Build Status

Heavily inspired by IAreKyleW00t/docker-caddy-cloudflare, the official Caddy Docker image with additional modules added:

docker pull docker.io/emarshal/caddy-custom:latest

Release Notes

See Caddy Releases.

Customization

This repository makes some opininiated choices for my particular environment/usage. Suggest reviewing at minimum, the following:

  • Included modules. (In Dockerfile.)
  • Supported platforms. (In docker/build-push-action step in docker.yaml.)

Tags

The following tags are available for the emarshal/caddy-custom image.

  • latest
  • <version> (eg: 2.6.4, including: 2.6, 2, etc.)

Usage

Refer to the official Caddy Docker image and docs for more information on using Caddy.

Create the container as usual and include your CF_API_TOKEN. We can utilizing Caddy's support for Environment varaiables to pass these values into our Caddyfile.

Then set the global acme_dns directive in your Caddyfile

{
  acme_dns cloudflare {env.CF_API_TOKEN}
}

See the caddy-dns/cloudflare module and tls directive for advanced usage.

Creating a Cloudflare API Token

You can generate a Cloudflare API token via the Cloudflare web console using the following steps:

  1. Login to your Dashboard
  2. Go to Account Profile > API Tokens
  3. Click "Create token" (Use the "Create Custom Token" option)
  4. Grant the following permissions:
    • Zone > Zone > Read
    • Zone > DNS > Edit

Building

You can build the Docker image locally by doing

docker build -t caddy-custom .