-
Notifications
You must be signed in to change notification settings - Fork 3
/
docker-compose-e2e.yml
executable file
·58 lines (57 loc) · 2.42 KB
/
docker-compose-e2e.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
version: "3.8"
services:
cy-open:
build:
context: ./client
dockerfile: Dockerfile.cy-open
image: taxi-app-cypress-e2e-test-browser
command: npx cypress open
# note: inside e2e-testing-cy-open container, the network allows accessing
# "client" host under name "localhost:3100"
# so "curl http://localhost:3100" would return whatever the webserver
# in the "client" container is cooking
# see https://docs.docker.com/compose/networking/
environment:
- CYPRESS_baseUrl=http://localhost:3100
- DISPLAY=unix${DISPLAY}
network_mode: 'host'
tty: true
# mount the host directory client/cypress and the file client/cypress.json as
# volumes within the container
# this means that:
# 1. anything that Cypress writes to these folders (e.g., screenshots,
# videos) appears also on the Docker host's filesystem
# 2. any change that the developer applies to Cypress files on the host
# machine immediately takes effect within the e2e-testing-cy-open container (no docker
# rebuild required).
volumes:
- ./client/cypress:/usr/src/app/cypress
- ./client/cypress.json:/usr/src/app/cypress.json
- ./client/coverage:/usr/src/app/coverage
- /tmp/.X11-unix:/tmp/.X11-unix
cy-run:
build:
context: ./client
dockerfile: Dockerfile.cy-run
image: taxi-app-cypress-e2e-test-run
command: npx cypress run
# note: inside e2e-testing-cy-run container, the network allows accessing
# "client" host under name "localhost:3100"
# so "curl http://localhost:3100" would return whatever the webserver
# in the "client" container is cooking
# see https://docs.docker.com/compose/networking/
environment:
- CYPRESS_baseUrl=http://localhost:3100
network_mode: 'host'
# mount the host directory client/cypress and the file client/cypress.json as
# volumes within the container
# this means that:
# 1. anything that Cypress writes to these folders (e.g., screenshots,
# videos) appears also on the Docker host's filesystem
# 2. any change that the developer applies to Cypress files on the host
# machine immediately takes effect within the e2e-testing-cy-run container (no docker
# rebuild required).
volumes:
- ./client/cypress:/usr/src/app/cypress
- ./client/cypress.json:/usr/src/app/cypress.json
- ./client/coverage:/usr/src/app/coverage