-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathdocker-compose.yml
44 lines (41 loc) · 1.23 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
37
38
39
40
41
42
43
44
version: '2'
services:
webapp:
build: .
ports:
- "8080:8080"
env_file:
- webapp.env
mongo:
image: mongo
ports:
- "27017:27017"
environment:
- MONGO_INITDB_DATABASE=hellogov
volumes:
- ./data/db:/data/db
e2e:
image: cypress
build: ./e2e
container_name: cypress
depends_on:
- webapp
# 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://webapp:8080
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