This is the development environment — a checkout you can run and change. For
installing FaPost on a server, see Self-hosting
instead; the two have different goals and different trade-offs.
With Docker
Nothing to install but Docker itself.http://localhost:8000, Vite on http://localhost:5173.
Why the dev image shares the production base
The development image is thedev target of docker/Dockerfile, built from the
same base stage as the production one. That is deliberate: a separately
assembled development image would have its own PHP build and extension set, and
every difference between the two becomes a bug that only appears after deployment.
What does differ is only what should:
- dev Composer dependencies are installed
- the source is mounted rather than copied, so edits are live
opcache.validate_timestamps=1, or nothing you type would take effect- the container runs as your user id, so files it writes stay yours
- Xdebug is available, off unless the image is built with
INSTALL_XDEBUG=1
vendor/ and node_modules/ are deliberately not mounted from the host.
They are installed inside the container for its own platform, and sharing them
would mix binaries built for a different OS.Xdebug
host.docker.internal, which resolves on Linux too
because compose maps it to the host gateway. If your IDE is elsewhere:
On your own machine
Requirements:- PHP 8.5.12 or newer
- Composer 2
- Node.js 20+ and npm
- PostgreSQL 15+ or compatible
- Redis
- PHP extensions:
pdo_pgsql,redis,intl,bcmath,gd,zip, pluspcntlandposixfor Horizon
1
Install dependencies
2
Prepare the environment
.env.example ships the credentials the Docker stack creates for itself, so
that path works unedited. Running against services you provisioned yourself
means pointing these at them:If your Redis runs without
requirepass, set REDIS_PASSWORD=null rather
than leaving it empty — Laravel reads the literal null as “no password”,
and an empty string is a password of zero length.3
Migrate and run
composer run dev starts the Laravel dev server, the queue listener, pail
log tailing, and the Vite dev server together.The Makefile
The repository root has aMakefile that wraps the everyday commands. It is a
front-end, not a second source of truth: where Composer holds a sequence
(setup, dev, test) the target delegates to it, so there is one definition
of each.
make with no arguments prints each target with its description and, under
it, the command that would actually run. Read that before running anything
unfamiliar: it also shows whether the command goes through a container.
Running commands inside a container
By default every target runs against whatever PHP is on yourPATH. If your
PHP lives in a container — devilbox, a Compose stack, anything docker exec
can reach — set CONTAINER and the PHP-side targets are prefixed with
docker exec automatically:
.make.local at the repository root.
The file is git-ignored: it describes your machine, not the project.
WORKDIR, where the checkout is inside the container, is worked out from the
container’s mounts: the mount whose host folder holds the checkout. Under
devilbox ~/Projects/php is /shared/httpd, so the checkout runs in
/shared/httpd/fapost-core and a task worktree next to it in
/shared/httpd/fapost-core.worktrees/<task> — in itself, not in the main
checkout. Set WORKDIR only when the container reaches the checkout some other
way than a mount; set in .make.local it applies to every worktree that file
is carried into. The container name comes
from Docker Compose: <project>-<service>-<index>, so devilbox’s PHP service is
server-php-1 and its PostgreSQL is server-pgsql-1.
Targets that run host tools stay on the host regardless of CONTAINER:
make dev (Vite needs the host’s Node), make docs-dev (Mintlify), the tunnel
targets. make shows which is which.
Task worktrees
An agent working through Jig may run a task in a worktree of its own (jig task start <id> --worktree). Jig copies .make.local into it and then
runs make worktree-setup (worktree.setup in .ai/config.yaml), which
prepares the worktree’s dependencies:
- by default the worktree has no
packages/, so the linkscomposer dev:linkandnpm run dev:linkmade into it are removed and the dependencies are installed fromcomposer.lockandpackage-lock.json— the task runs on the versions Core pins, as CI does; - a task that edits the packages is started with
--share packages: the worktree sees your checkouts underpackages/, and the setup installs yourcomposer.overlay.jsonand links the checkouts Core accepts, as in your main checkout.
make worktree-setup, or through
jig task bootstrap <id>.
Adding packages on top of Core
To work against a package Core does not require — a Solution, a Plugin or a private extension — without touching Core’scomposer.json, use a composer overlay. See
Development setup → Packages Core does not require.
Checks
make test, make test-arch, make fix.
See Testing and architecture checks for what each covers.