General purpose docker compose files for developing wordpress sites, themes, plugins.
-
If you are new to watchman:
watches files and records, or triggers actions, when they change.
In this repo, it is used by
link:*
andunlink:*
commands/scripts because docker volume api do not work with symbolic links. So the link-like strategy is "watch and rsync".
NOTE:
Every command can be executed manually or using the sh scripts wrapper (the cli file).
To use the cli.sh file you should to run this command: chmod +x cli
-
Clone this repo:
-
Manually:
git clone [email protected]:danieletulone/docker-wordpress.git
-
Using sh wrapper: No wrap command for clone
-
-
Create .env file copying .env.example file:
-
Manually:
cp .env.example .env
-
Using sh wrapper:
./cli install
-
-
(optional) Symlink your theme(s) or create folders into volumes.
-
Manually:
link -s path/themes/example ./volumes/wordpress/themes
-
Using sh wrapper:
./cli link:theme path/themes/example
-
-
(optional) Symlink your plugin(s) or create folders into volumes.
-
Manually:
link -s path/themes/example ./volumes/wordpress/themes
-
Using sh wrapper:
./cli link:plugin path/plugins/example
-
./cli clean
Stop containers and remove volumes.
You can pass every option of down
command of docker compose.
./cli install
Install necessary things to allow to use correctly the docker-wordpress.
No options.
./cli link:theme my-theme-path
Run a watcher for source directory and rsync it into ./volumes/wordpress/themes.
Internally, it use watchman because docker volume api do not work with symbolic links. So the link-like strategy is "watch and rsync".
Use unlink:theme to unlink.
No options.
./cli link:plugin my-theme-path
Run a watcher for source directory and rsync it into ./volumes/wordpress/plugins.
Internally, it use watchman because docker volume api do not work with symbolic links. So the link-like strategy is "watch and rsync".
Use unlink:plugin to unlink.
No options.
./cli start
Install necessary things to allow to use correctly the docker-wordpress.
You can pass every option of up
command of docker compose.
./cli stop
Install necessary things to allow to use correctly the docker-wordpress.
You can pass every option of down
command of docker compose.
./cli unlink:plugin my-theme-path
Stop the watcher for source directory and remove directory from ./volumes/wordpress/plugins.
No options.
./cli unlink:theme my-theme-path
Stop the watcher for source directory and remove directory from ./volumes/wordpress/themes.
No options.
The start
script handles automatically that for you and merges (or not) multiple docker-compose files. Tested on MacOs with M2.