forked from cypress-io/cypress-example-docker-compose
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
36 lines (35 loc) · 1.16 KB
/
docker-compose.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
version: '3'
services:
web:
image: apache
build: ./webapp
container_name: apache
restart: always
# we can see the server running at "localhost:8080"
ports:
- "8080:80"
e2e:
image: cypress
build: ./e2e
container_name: cypress
depends_on:
- web
# note: inside e2e container, the network allows accessing
# "web" host under name "web"
# so "curl http://web" would return whatever the webserver
# in the "web" container is cooking
# see https://docs.docker.com/compose/networking/
environment:
- CYPRESS_baseUrl=http://web
command: npx cypress run
# mount the host directory e2e/cypress and the file e2e/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 container (no docker
# rebuild required).
volumes:
- ./e2e/cypress:/app/cypress
- ./e2e/cypress.json:/app/cypress.json