Docker Compose

Experimental: run PhlatPage in containers with Docker Compose instead of a local PHP install.

On this page

Experimental. The Compose setup works, but it may change between releases. PhlatPage does not need Docker: any web server running PHP 8.4 with its document root at site/public/ is enough. See the Quickstart.

Compose is useful when your host lacks a PHP extension the app needs (such as imagick), or when you want the same stack on every machine.

Requirements

  • Docker with Compose
  • Node.js and npm, to build the CSS and JS on the host

Start

Install and build as in the Quickstart, then start the stack:

docker compose up -d

The site is served at http://localhost:10000. Mailpit catches outgoing mail: its inbox is at http://localhost:8025.

Run commands in the container

The project is mounted at /app, so run the CLI inside the fpm service:

docker compose exec fpm php phlat/addons/cli/phlat user:create alex --role=admin
docker compose exec fpm composer install

Stop

docker compose down stops the stack. Pages and data live in the project folder, so nothing is lost.

Services

The fpm, caddy and mailpit services, and their compose.yaml, are described in Deploy.