-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
66 lines (61 loc) · 1.33 KB
/
docker-compose.yml
File metadata and controls
66 lines (61 loc) · 1.33 KB
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
59
60
61
62
63
64
65
66
version: "3.8"
services:
# SYSTEM UNDER TEST
frontend:
build:
context: .
dockerfile: Dockerfile.frontend
ports:
- 30002:3002
depends_on:
backend:
condition: service_started
environment:
PORT: 3002
BACKEND_URL: "backend:3001"
backend:
build:
context: .
dockerfile: Dockerfile.backend
ports:
- 30001:3001
depends_on:
database:
condition: service_healthy
api-mock:
condition: service_started
environment:
PORT: 3001
DATABASE_URL: "database:27017"
COINCAP_URL: "http://api-mock:3003/coincap"
database:
image: mongo:7.0.7-rc2-jammy
restart: always
ports:
- 27017:27017
volumes:
- ./init-database/init-mongo.js:/docker-entrypoint-initdb.d/init-mongo.js:ro
environment:
MONGO_INITDB_ROOT_USERNAME: username
MONGO_INITDB_ROOT_PASSWORD: password
healthcheck:
test: mongosh --port 27017 --quiet
interval: 10s
timeout: 10s
retries: 3
start_period: 5s
# TEST ENVIRONMENT
tests:
build:
context: .
dockerfile: Dockerfile.tests
environment:
CYPRESS_BASE_URL: "http://frontend:3002"
api-mock:
build:
context: .
dockerfile: Dockerfile.api-mock
ports:
- 3003
environment:
PORT: 3003