Or the LFDJ Stack (Laravel + FrankenPHP + Docker + Just)
A minimal setup for running a Laravel 12 application with FrankenPHP, Docker, and just for task automation, without you needing to install PHP, Node, FrankenPHP, Composer, etc. Admittedly you still need Docker and Just installed, but I find those an acceptable minimum.
Comes with Mailjet & PostgreSQL 😎
Every binary/cli tool you need is directly aliased in the current shell session, mimicking a real tool install. For instance, you may directly run php artisan ... (or artisan ...) commands as they are aliased to docker commands. You can now copy/paste commands directly from the web!
You may even run npm (or bun) commands the way you would normally with locally installed binaries.
To enable this, refer to Use shell aliases.
- Install node dependencies the same way or similar
- Set up database in
docker-compose.yml - Added convenience aliases for QoL (
up,down,composer,php,npm,bun,artisanandpsql) - Add various other tools/Laravel plugins?
- Sail support (easier to manage php versions)
- Octane out of the box support? (might make dev a bit harder)
- Docker
- just (task runner)
This repo was solely tested on a Fedora 42+ system. I would recommend running this repo either in WSL or macOS.
just installYou should run this command right after creating this repository. This will create a full laravel initial installation.
It is important you run this recipe first as to avoid creating a database with wrong credentials (among other things).
Warning
Ignore this step if you already have the functions up and down in your terminal profile.
To make development easier and add contextual aliases to your shell, you may run:
just shell-setup >> ~/.zshrc # or ~/.bashrc
source ~/.zshrc # or ~/.bashrcTo add two functions up and down.
up: starts the containers and sources aliases for composer, artisan and psql to the dockerized applicationdown: stops the containers and removes the aliases
Tip
These convenient functions will save you a few keystrokes when interacting with your containers. composer here is docker compose exec app composer and artisan is docker compose exec app php artisan.
Once the install has completed, you may start the development environment with:
up
# or if you don't have the convenience aliases installed:
just upThis will create the other containers, and run migrations.
You can now visit: http://localhost:8000
| Command | Description |
|---|---|
just install |
Install Laravel |
just up |
Start the development environment |
just down |
Stop containers |
just clean |
Stop containers and remove volumes |
just reset |
Deletes all files except core config files |
| Alias | Description |
|---|---|
up |
Start the development environment and source the aliases |
down |
Stop containers and unset the aliases |
deactivate |
Unset all aliases |
php |
Use the dockerized PHP CLI |
artisan |
Use the dockerized Artisan CLI |
composer |
Use the dockerized Composer CLI |
psql |
Use the dockerized postgres CLI |
npm |
Use the dockerized npm CLI |
bun |
Use the dockerized bun CLI |
Example usages:
php artisan migrateartisan key:generatecomposer require filament/filament:"^4.0"bun installnpm run devpsql: connects you inside the postgres instance
You can reset the whole repository with just reset. This command is mostly useful is something went bad during install or during template development.
This command deletes everything in the project directory and restores the project back to how it was mostly looking when initially pulled.
You’ll be prompted to confirm before anything is deleted.