Run a Docker setup of Caddy + MariaDB + Adminer on your Raspberry Pi with one simple command!
- Set up your Raspberry Pi with HypriotOS.
- Install git on your Pi via
sudo apt-get install git
and clone this repo. - Set your preferrences (see below).
- Build your docker image for caddy
cd
intodocker/
and rundocker-compose -f webpi.yaml up -d
If everything works you should see "Hello World" via http://192.168.0.XX (the IP for your Pi). Manage your database via Adminer on 192.168.0.XX:2015.
Service | Port |
---|---|
Caddy | 80 |
MariaDB | 3306 |
Adminer | 2015 |
Make sure to change the following settings:
Service | Folder | Contents |
---|---|---|
docker-compose file | docker/webpi.yaml |
Set the name for your caddy image under web: ... image: |
docker-compose file | docker/webpi.yaml |
Change your MY_SQL settings under environment |
index.php | caddy/www/index.php |
Set values for accessing MariaDB via PHP |
The Caddyfile will be taken from docker/caddy/
and mounted into /etc/Caddyfile
inside the container. www/
will be mounted into /srv/www/
A fresh instance of MariaDB will be mounted into /var/lib/mysql/
inside the container. If you have any existing databases, just move them into mariadb/db
before you run docker-compose
!