-
Notifications
You must be signed in to change notification settings - Fork 1
/
compose.local-test.yaml
75 lines (72 loc) · 1.68 KB
/
compose.local-test.yaml
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
67
68
69
70
71
72
73
74
75
version: '3'
services:
db:
image: postgres:16-alpine
environment:
- POSTGRES_PASSWORD=postgres
container_name: test-db
profiles: [test-setup, cypress]
expose:
- 5432
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 1s
timeout: 10s
retries: 60
backend:
build:
context: ./backend
dockerfile: Dockerfile.dev
command:
- /bin/sh
- -c
- |
npm run db:migrate
npm run db:seed:all
npm run watch:test
while ! curl -fsS http://localhost:3001/api >/dev/null; sleep 1; done
echo "Test setup is now up!"
expose:
- 3001
volumes:
- ./backend:/usr/src/app
- /usr/src/app/node_modules
environment:
- PORT=3001
- SECRET=yoursecrethere
- EMAIL_ENABLED=false
- DATABASE_URL=postgres://postgres:postgres@db:5432/postgres
container_name: test-backend
profiles: [test-setup, cypress]
depends_on:
db:
condition: service_healthy
frontend:
build:
context: ./frontend
dockerfile: Dockerfile.dev
command: npm run dev
ports:
- 3002:3000
volumes:
- ./frontend:/usr/src/app
- /usr/src/app/node_modules
container_name: test-frontend
profiles: [test-setup, cypress]
depends_on:
- backend
- db
cypress:
image: cypress/included:13.8.0
container_name: cypress
profiles: [cypress]
volumes:
- ./frontend/e2e:/e2e
- ./frontend/cypress.config.js:/cypress.config.js
environment:
- CYPRESS_baseUrl=http://frontend:3000
- CYPRESS_VIDEO=false
depends_on:
- db
- backend
- frontend