Statamic Starter is a Docker development environment to make Statamic V3 development even more fun and easy.
- Docker Desktop >= 3.4
- To create a new Statamic development environment, put the following configuration to your
docker-compose.yml
:
services:
statamic:
image: ghcr.io/o1y/statamic-starter:latest-php8.1
ports:
- 8080:8080
volumes:
- ./:/var/www/
- Start the container:
docker compose up
After starting the container for the very first time the startup script checks if a Statamic project is available. If not, it will install a fresh copy.
- Wait until you see
Statamic is ready
and open a browser of your choice and access your Statamic development environment:
http://localhost:8080
To run please get a bash shell in the container first:
docker compose exec statamic bash
Now you can run php artisan
or php please
.
An alternative way to run please
or artisan
commands in your container is:
docker compose exec statamic php please
docker compose exec statamic php artisan
The easiest way to create your first user is by running
docker compose exec statamic php please make:user
You should put your environment variables for local development into your .env
file. Whenever you change that file, the php server will perform a reload.
However, you should not commit your local .env
into your project. Instead use the file .env.docker
, which we create during the initial Statamic installation.
In your composer.json
, change the statamic/cms
version to the version number of your choice, e.g:
"statamic/cms": "3.2.*"
Then run:
docker compose exec statamic composer update statamic/cms --with-dependencies
The image is not ready for production use yet. Feel free to create a PR :)
© MIT Oliver Mesieh