-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.test.yml
45 lines (41 loc) · 1.11 KB
/
docker-compose.test.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
networks:
devnetwork:
services:
db-test:
image: postgres:latest
environment:
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- POSTGRES_DB=${POSTGRES_DB}
ports:
- "5433:5432"
volumes:
- postgres-test-data:/var/lib/postgresql/data # Persist data even after container is removed
networks:
- devnetwork
frontend-tests:
build:
context: .
dockerfile: frontend/Dockerfile
image: interview-prep-frontend-tests:latest
working_dir: /app/frontend
command: npm run test -- --watch=false --browsers=ChromeHeadlessNoSandbox
networks:
- devnetwork
backend-tests:
build:
context: ./backend
dockerfile: Dockerfile
environment:
- NODE_ENV=test
- DATABASE_URL=${DATABASE_URL}
image: interview-prep-backend-tests:latest
working_dir: /app/backend
depends_on:
- db-test
command: sh -c "npm run test:clearCache && npm run test:users && npm run test:products && npm run test:unit"
# command: tail -f /dev/null
networks:
- devnetwork
volumes:
postgres-test-data: