Caddy image to serve http or https with php. Forked from abiosoft/caddy-docker to arm
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.dockerignore
Caddyfile
Dockerfile
LICENSE
README.md
index.php

README.md

Caddy+PHP for ARM

A Docker image for Caddy that will let you to serve http or https with php support, with Let's Encrypt certificate autogenerated. This image includes the git plugin. Plugins can be configured via the plugins build arg. Forked from abiosoft/caddy-docker replacing the official Alpine Linux base image with hypriot/rpi-alpine-scratch from the amazing people of Hypriot Pirate Crew in order to build a suitable image for arm devices such as rpi, odroid. I replaced this image in latest version with almost docker official image arm32v6/alpine from Docker Official Images

Be aware! You should read carefully the usage documentation of the original repository! abiosoft/caddy-docker

Details

Enhancements

Getting Started

This is a simple usage for testing proposes.

$ docker run -d -p 2015:2015 elswork/arm-caddyphp:latest

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

My Real Usage Example

In order everyone could take full advantages of the usage of this docker container, I'll describe my own real usage setup.

$ docker run -d \
    --name myarm-caddyphp \
    -p 80:80 -p 443:443 \
    -v /var/www/html:/srv \
    -v $HOME/Caddyfile/phphttps:/etc/Caddyfile \
    -v $HOME/.caddy:/root/.caddy \
    elswork/arm-caddyphp:latest

Description of parameters

--name myarm-caddyphp This is absolutely optional, it helps to me to easily identify and operate the container after the first execution.

$ docker start myarmphp-caddy
$ docker stop myarmphp-caddy
$ docker rm myarmphp-caddy
...

-p 80:80 -p 443:443 Caddy will serve https by default.

-v /var/www/html:/srv /var/www/html is the local folder where I have the files to serve. I mount in the container folder that Caddy use to serve files.

-v $HOME/Caddyfile/phphttps:/etc/Caddyfile $HOME/Caddyfile/phphttps is my Caddy configuration file.

mydomain.com, www.mydomain.com {
browse
fastcgi / 127.0.0.1:9000 php
startup php-fpm7
gzip
log stdout
errors stdout
tls user@host.com
}

-v $HOME/.caddy:/root/.caddy I mount the folder where I will store the Let's Encrypt certificates that will be generated automatically the first time the container run, in order to prevent regenerating them each time.

Let's Encrypt Auto SSL

Note that this does not work on local environments.

You must use a valid domain properly configured to point your docker server and add email to your Caddyfile to avoid prompt at runtime.