From 7135d5bebf82cc254a3e827d1035f996986ca5b9 Mon Sep 17 00:00:00 2001 From: Jason McCallister Date: Tue, 22 Oct 2019 08:25:38 -0400 Subject: [PATCH] Adding docs for testing with Docker --- .vuepress/config-en.js | 3 ++- testing/framework/docker.md | 31 +++++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 testing/framework/docker.md diff --git a/.vuepress/config-en.js b/.vuepress/config-en.js index 00d306b3d1b..142fe98a846 100644 --- a/.vuepress/config-en.js +++ b/.vuepress/config-en.js @@ -114,7 +114,8 @@ module.exports = { 'framework/mocking', 'framework/support-classes', 'framework/full-mock', - 'framework/assertion-helpers' + 'framework/assertion-helpers', + 'framework/docker', ] }, diff --git a/testing/framework/docker.md b/testing/framework/docker.md new file mode 100644 index 00000000000..93d19e361bd --- /dev/null +++ b/testing/framework/docker.md @@ -0,0 +1,31 @@ +# Testing with Docker + +To make things easier, Craft ships with a `docker-compose.yaml` file in the tests directory. This is useful when you +need to run tests against Craft supported databases. + +Instead of installing PostgreSQL and MySQL/MariaDB on your machine, you can use the `docker-compose.yaml` file to +scaffold the databases. + +## Ports + +The Docker Compose file that ships with Craft is configured with PostgreSQL and MySQL on the following ports: + +| Database | Port | +| ----------- | ----------- | +| PostgreSQL | 5432 | +| MySQL | 3306 | +| MariaDB | 33061 | + +::: tip +If these ports conflict with an existing install, you can update the port on the `docker-compose.yaml` file to look like +this: + +```yaml +mysql: + image: mysql:5.6 + ports: + - 33060:3306 +``` + +The port on the left side of the colon is your physical machine port and can be changed at will (remember to update your .env to use the new port). +:::