| Filename | Latest commit message | Latest commit date |
|---|---|---|
| .. | ||
| public | ||
| .env.example | ||
| Caddyfile | ||
| docker-compose.yml | ||
| README-pt.md | ||
| README.md | ||
PHP site
A PHP site with no dependencies: a home page, a contact form that checks its fields, and /health. PHP 8.3 runs in PHP-FPM, behind Caddy with HTTPS. The code also works on PHP 7.4.
Files
public/index.php: the site. Every file inpublic/is served; keep everything else outside it.Caddyfile: HTTPS forDOMAIN, PHP throughphp_fastcgi.docker-compose.yml: PHP-FPM and Caddy..env.example: copy it to.envand setDOMAIN,SITE_NAMEandTZ.
The form only checks the fields. To receive the messages, send them from index.php through your email service, for example the E-mail Center API of Interweb Mozambique (https://docs.interweb.co.mz/email-center/), with the API key in .env.
Try it on your computer
php -S localhost:8000 -t public public/index.php
Or with Docker: cp .env.example .env, set DOMAIN=localhost and run docker compose up -d.
Publish on your VPS
From the templates folder: sh deploy.sh php-app root@<server ip>. See the main README for the IP and the DNS records.