forked from ringcentral/testring
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
115 lines (107 loc) · 2.43 KB
/
docker-compose.yml
File metadata and controls
115 lines (107 loc) · 2.43 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
# ============================================
# Ringai Docker Compose - Local Development
# ============================================
# Usage:
# docker compose run --rm test # Run unit tests
# docker compose run --rm test-e2e # Run e2e tests
# docker compose run --rm test-unit # Run unit tests only
# docker compose run --rm dev # Start dev container
# docker compose build --target ci # Build CI image
# docker compose build --target dev # Build dev image
services:
# Base test container
test:
build:
context: .
dockerfile: Dockerfile
target: test-runner
volumes:
- .:/app
- node_modules:/app/node_modules
- core_modules:/app/core/node_modules
- packages_modules:/app/packages/*/node_modules
environment:
- CI=true
- PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1
working_dir: /app
command: pnpm run test:unit
# Unit tests only
test-unit:
build:
context: .
dockerfile: Dockerfile
target: test-runner
volumes:
- .:/app
environment:
- CI=true
working_dir: /app
command: pnpm run test:unit
# E2E tests
test-e2e:
build:
context: .
dockerfile: Dockerfile
target: test-runner
volumes:
- .:/app
environment:
- CI=true
- PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=0
working_dir: /app
command: pnpm run test:e2e:headless
shm_size: '2gb' # Required for Playwright
# CI test runner (with coverage)
ci:
build:
context: .
dockerfile: Dockerfile
target: ci
volumes:
- .:/app
environment:
- CI=true
working_dir: /app
command: pnpm run test:unit:coverage
# Development container
dev:
build:
context: .
dockerfile: Dockerfile
target: dev
volumes:
- .:/app
environment:
- CI=false
working_dir: /app
stdin_open: true
tty: true
command: /bin/bash
# Linter
lint:
build:
context: .
dockerfile: Dockerfile
target: test-runner
volumes:
- .:/app
environment:
- CI=true
working_dir: /app
command: pnpm run lint
# Type check
type-check:
build:
context: .
dockerfile: Dockerfile
target: test-runner
volumes:
- .:/app
environment:
- CI=true
working_dir: /app
command: pnpm run build:types:check
volumes:
node_modules:
core_modules:
packages_modules: