A simple and quickly docker container for wordpress development.
This container has Wordpress, Mysql and Adminer.
- Clone the repo or download it.
- Run
docker compose up -d
. - Access http://localhost:8080 in your browser and setup wodpress.
- Start coding your theme in
theme
folder.
- Only your theme folder is mapped, this covers most common wordpress projects. If you want map more folder, just added in
docker-compose.yml
file, like:
volumes:
- ./theme:/var/www/html/wp-content/themes/mytheme
- ./plugins:/var/www/html/wp-content/plugins
-
You can access Adminer in http://localhost:8888.
-
This container doesn't have
restart: always
config purposely, just to have more control what sites (containers) I am working in the moment. You can add indocker-compose.yml
if you want. -
If you have to run multiple wordpress sites (containers) in the same time, make sure you change the ports mapped in
docker-compose.yml
, use a different port for each site (dont forget Adminer's ports) -
If you have trouble with permission in theme folder (or another folder that you are mapped) in linux or WSL, use the command:
sudo chown your_user ./theme
,