Docker - HelpRefugees/project-flamingo GitHub Wiki
Note that this is intended primarily to support development on Windows
machines, where we had trouble running Cypress in the yarn ship script, and is
not run as part of the build in Travis.
There are three steps to the e2e:docker process:
docker-compose buildto build the containers;docker-compose run cypress e2eto execute the E2E tests in the Cypress container; anddocker-compose downto stop all of the other containers.
Containers
The Docker network consists of four containers:
-
flamingo: the app itself, running in the production mode (i.e. the Express app serves both the API and the compiled React frontend). This image is produced in a multi-step build using theDockerfilein the project root directory. -
cypress: runs the E2E tests using the Cypress Chrome browser image, built frome2e/Dockerfile. The default command for this image is justyarn -v, so you can usedocker-compose upto bring up the network if you don't want to run the tests. -
zapier: a test double providing the email webhook. This is a simple spy that accepts anyPOSTrequest and stores the body, built frome2e/fixtures/Dockerfile. -
flamongo: the Mongo database. This is just the regularmongo:4-xenialimage.
Network
According to the network rules: flamingo can access both flamongo and
zapier; cypress can access all three other containers. For example, here is
a sequence diagram (generated using
https://davidje13.github.io/SequenceDiagram/) showing a test that touches all
four containers:
