Appearance
Docker: compose, App Platform, AWS ECS and App Runner, Coolify
One image of the site for any host that runs containers: a VPS with docker compose, Coolify, Fly.io, AWS ECS or App Runner, DigitalOcean's App Platform. PHP-FPM and Nginx run in one container; the same image runs the worker and the scheduler with another command. What the server needs and where else to host: Deployment.
With the deploy kit
bash
php artisan kitloom:deploy-kit docker --domain=example.com| File | What it is |
|---|---|
Dockerfile | php: with the extensions, Nginx and supervisord; a vendor stage that installs the packages with COMPOSER_ as a build argument — the stage is not in the image, so the token never reaches its history; a stage with Node that builds the Vue and React themes when a theme needs it (PHP stays there: a TypeScript theme asks it for the page types), their SSR bundles copied into the image with Node's binary to run them; the image with the entrypoint, port 8080 and a health check on / |
docker/ | The container's nginx., php. (uploads up to 64 MB, OPcache without file checks, on for the console too), supervisord. (PHP-FPM, Nginx and, with a Vue or React theme, the SSR server php artisan inertia:), entrypoint. (Laravel's caches from the container's environment, the migrations and storage: for the site, any command as www- for the worker and the scheduler, a managed database's CA certificate from DB_), auth. for the token |
. | vendor, node_modules and the built themes are made inside the build; the environment and the credentials never go in |
compose. | One host: the site on port 80, the worker, the scheduler, MySQL 8.4, Redis with Horizon; volumes for the uploads and the database |
deploy/ | The environment of every container, and MySQL's: to fill in and keep out of the repository |
deploy/ | The steps for this site, and what a platform that runs the image needs |
One host with docker compose
cp docker/, fill in your kitloom customer name and token (and the Nova license on a Nova site); addauth. json. example docker/ auth. json docker/andauth. json deploy/todocker. env ..gitignore deploy/:docker. env APP_(KEY php artisan key:), the database passwords, a real mailer; with AI agents, Passport's keys —generate -- show php artisan kitloom:on your machine (see below).passport- keys >> deploy/ docker. env Build and start:
bashCOMPOSER_AUTH="$(cat docker/auth.json)" docker compose up -d --buildThe
appcontainer runs the migrations once the database answers, then serves on port 80; the worker and the scheduler start once it is healthy.docker compose logs -watches it come up.f The first administrator — or WordPress's database loaded into the
dbcontainer instead, withDB_inPREFIX deploy/:docker. env bashdocker compose exec app php artisan kitloom:user --login=admin [email protected] --no-interactionHTTPS: a reverse proxy in front of port 80 — Caddy or Traefik in a container of their own, or the host's Nginx — with
APP_as the address it answers on.URL
A new release is the same docker compose up - after a pull; compose replaces the containers one by one. The uploads stay in the uploads volume, the database in db.
A platform that runs the image
ECS, App Runner, App Platform, Coolify, Fly.io: the image is built from the Dockerfile with COMPOSER_ as a build-time variable, and the platform gives the containers their environment — deploy/ without the MYSQL_ lines, the database's address from the platform. Three things change without a shared disk:
- The uploads go to a bucket:
MEDIA_with theDISK=s3 AWS_variables of S3 or Spaces (* composer require league/when it is not installed yet), andflysystem- aws- s3- v3 HEALTH_, so Site Health checks that nothing is left on a container's disk.EPHEMERAL_ DISK=true - The worker and the scheduler are services of the same image with
php artisan queue:(orwork -- sleep=3 -- tries=3 -- max- time=3600 php artisan horizon) andphp artisan schedule:as their command: the entrypoint runs any command as the web user, with the caches built first.work - Import & Export reads the WXR file from
IMPORT_, and the worker that imports it runs in another container: a private bucket for it, as aEXPORT_ DISK privatedisk added toconfig/, andfilesystems. php IMPORT_.EXPORT_ DISK=private
Passport's keys. AI agents sign in to the site with OAuth, and every token they are given is signed with Passport's key pair. When the pair changes, those tokens stop working and every connected agent is signed out; with a different pair in two containers, an agent is refused at random. A container's own disk is gone with the next build, so the pair is in the environment, PASSPORT_ and PASSPORT_ — the two lines of php artisan kitloom:, made once on your machine (the \ in them are the key's line breaks); a platform takes each value without its quotes. They are secrets, as APP_ is; while they are not set, the entrypoint says so in the log. To change them (a key has leaked): a new pair the same way, then new containers; every agent then signs in again.
KITLOOM_ stays: a module switched on the Modules screen asks for new containers, which build their caches with every module on (Enabling & Disabling).
DigitalOcean App Platform
bash
php artisan kitloom:deploy-kit digitalocean-app --domain=example.comThe same image, and .: the web service, the worker and the scheduler as components of the image, built from the GitHub repository on every push; a managed MySQL cluster attached by name and bound into the environment (${db. and the rest, the CA certificate through the entrypoint); the uploads in a Space behind its CDN; Valkey with Horizon; the domain. The secrets — APP_, COMPOSER_ for the build, the Space's key and secret, and with AI agents PASSPORT_ and PASSPORT_ from php artisan kitloom: — are filled in the dashboard, so the spec can be committed.
In order: a Space for the uploads with its CDN and an access key; the database cluster, made before the app, since App Platform's own development databases are Postgres only (doctl databases create example-); the repository connected to DigitalOcean; doctl apps create --; the secrets in Settings → App-Level Environment Variables, which starts the build; the first administrator from the web component's Console; the domain's DNS as Settings → Domains says. A change to the spec goes up with doctl apps update <app-; a change to the code, with a push. deploy/ has every step for this site.
AWS ECS and App Runner
The image as above, pushed to ECR (aws ecr get-, docker build --, docker push). App Runner runs it as one service from the image with the environment in its console; ECS as a task definition with three containers of the image — the site on port 8080, the worker and the scheduler with their command — behind a load balancer whose health check is /. RDS for MySQL (its endpoint as DB_; the RDS CA bundle as MYSQL_ if the parameter group requires TLS), S3 for the uploads, SES for the mail. Both builders pass COMPOSER_ as a build argument; nothing of it is in the pushed image.