Skip to content
This repository was archived by the owner on Mar 28, 2024. It is now read-only.

Caddy v1.0.5

Quentin McGaw edited this page May 22, 2020 · 3 revisions

Setup

  1. Create a Caddyfile with the content you would like.

  2. Create a data directory: mkdir data

  3. Change the ownership and permission to match the Docker container

    chown 1000 Caddyfile data
    chmod 700 Caddyfile data

    If you are on Windows, you may skip this step.

  4. Assuming your current file path is /yourpath, run the container with:

    docker run -d --name caddy \
        -v /yourpath/Caddyfile:/Caddyfile:ro \
        -v /yourpath/data:/data \
        -p 80:8080/tcp -p 443:8443/tcp \
        qmcgaw/caddy-scratch:v1.0.5

Docker Compose

You can also run the container with docker-compose up -d and using this docker-compose.yml:

version: "3.7"
services:
  caddy:
    image: qmcgaw/caddy-scratch:v1.0.5
    container_name: caddy
    volumes:
      - ./Caddyfile:/Caddyfile:ro
      - ./data:/data
    network_mode: bridge
    ports:
      - 80:8080/tcp
      - 443:8443/tcp
    environment:
      - TZ=
    restart: always

Log times

If log times are not correct, it's because you need to set your timezone in the TZ environment variable. For example, add -e TZ=America/Montreal to your Docker run command.

Update

Update the docker image with docker pull qmcgaw/caddy-scratch:v1.0.5. Note that no updates should be brought up to v1.0.5, you should switch to the :v2.0.0 or :latest Docker tag.

Plugins

You need Git installed.

If you want to have for example the minify and the ipfilter plugins, build the image with:

docker build -t qmcgaw/caddy:v1.0.5 --build-arg PLUGINS=minify,ipfilter https://github.com/qdm12/caddy-scratch.git#v1.0.5

Caddyfile reload

To reload the Caddyfile in Caddy, use:

docker kill --signal=USR1 caddy

Enable telemetry

You need Git installed.

Telemetry is disabled by default. You can enable it by building the image with:

docker build -t qmcgaw/caddy:v1.0.5 --build-arg TELEMETRY=true https://github.com/qdm12/caddy-scratch.git#v1.0.5

Clone this wiki locally