MODX Revolution Development Docker
Docker setup that makes it easier to clone and set up MODX Revolution from GitHub.
Cloning MODX Revolution from GitHub and doing all the necessary setup can be a tedious process. Not to mention configuring PHP, Apache/nginx and MySQL/MSSQL correctly. This Docker setup does all of this work for you with a few simple commands. It creates a Apache (2.4.10) web server running PHP (7.1.2), as well as a MySQL database (5.7.17). The web server mounts your MODX Revolution files and exposes them to you via localhost.
Note that Docker compose is included in the Docker Toolbox, so if you install that you do not need to install the standalone version.
We supply a Makefile to make it easier to use this setup. UNIX based systems should have Make installed by default. Windows systems need to install this manually. It is also possible to use this setup without Make, but you will have to type out some of the tasks manualy instead of relying on the provided shortcuts.
First, make sure you have forked the MODX Revolution repository as described in the rtfm pages. You only need to follow the steps under "Installation Process" before the section named "Run the Build".
Now that you have your up-to-date fork, clone it in THIS directory into
revolution. Example command:
git clone firstname.lastname@example.org:[your-username]/revolution.git
With the files in place, we can now spin up the Docker containers. A Makefile is provided to automate some of the process.
To build and start everything:
To stop the machine type:
We also provide a command for building the transport file. This is necessary to do before you can run the MODX setup if you do not already have the
core.transport.zip file in your package directory. This command also copies
.htaccess. Note that this command takes some time to finish. Run it with:
The other commands are listed in the Makefile, and should be relatively self explanatory.
You can also access the database on port
3306. On UNIX based systems this is through localhost, but Windows machines also require the Docker machine IP for this. Username, password and database name are all
I am pretty new to Docker myself, so there might be better ways of doing certain things. Feel free to open PRs and issues.