-
Build the Craft 3 image locally from the Dockerfile:
docker build -t courtneymyers/craft3 .
or download it from Docker Hub:
docker pull courtneymyers/craft3:latest
Optionally download the MariaDB image from Docker Hub as well (not required, as it’ll get pulled in step 3, if you don't already have it locally):
docker pull mariadb:10.3
-
Set environment variables for the database, and Craft in the following files:
Duplicateenv/.craft.env.example
asenv/.craft.env
(CRAFT_PASSWORD
must be at least 6 digits long)
Duplicateenv/.mysql.env.example
asenv/.mysql.env
-
Run setup script:
sh setup.sh
-
When done with local development, stop each container individually:
docker container stop craft-db
docker container stop craft-cms
And to resume at a later point:
docker container start craft-db
docker container start craft-cms