Docker-compose and VS Code Remote Container environment featuring:
- mysql8
- wordpress (wordpress/apache)
- wp-cli & composer (devcontainer)
- mailhog (fake mail)
- phpmyadmin (db admin)
- NPM
- Docker
- Docker-compose
- VS Code w/ Remote Containers extension (optional)
Copy the .env.example file to .env and customize as necessary (you might not need to change anything)
cp .env.example .env
To start, clone the repo and then run NPM install:
git clone [email protected]:cds-snc/platform-mvp.git
cd platform-mvp
npm i
Then you can bring up the environment using docker-compose:
docker-compose up
Once the services are running, you can access a cli environment preconfigured with all the tools needed for development:
npm run cli
Alternatively, you can open the project in VS Code Remote Containers:
- Open the project in VS Code
- When prompted "Reopen in container" or press F1 -> Remote-Containers: Open folder in container
- VS Code will open a devcontainer terminal environment
Either way, once the environment is up, the site will be available on localhost
:
- Visit
localhost
to see your new WordPress install - Visit
localhost/wp-admin
to see the admin interface
Wordpress will be installed with some pre-configured plugins and themes, and will be configured as a multi-site install. There will also be a default administrator account, with the following credentials:
username: admin password: secret
Local mailcatcher for fake email sending. To use it, configure your WordPress install to use the SMTP interface.
Web interface: localhost:8025
SMTP interface: mailhog:1025
Web admin for MySQL database.
Web interface: localhost:8080
Pre-installed plugins:
This project is configured to use Composer to manage WordPress Themes and Plugins.
To install a plugin or theme, find it on WPackagist, add it to composer.json, and run composer install
or use composer require wpackagist-[plugin|theme]/[package-name]
. These commands should be run from within the wordpress
folder.
Note: when starting up the devcontainer or docker-compose, composer install
is run to automatically install plugins and themes defined in composer.json.
When creating a custom plugin or theme, you should prefix the folder name with cds-
. This will ensure the code is included in git and code quality scans.
See: #95 (comment)