-
Notifications
You must be signed in to change notification settings - Fork 3
/
compose.test.yml
46 lines (43 loc) · 1008 Bytes
/
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
46
services:
test:
image: node:18-alpine
command: npm run jest
working_dir: /usr/src/app
ports:
- 9227:9227 # debug
volumes:
# use local files as source
- .:/usr/src/app
environment:
NODE_ENV: test
# contains db connection info that matches db service setup below
CONFIG_FILE: config-test.json
# waits for db and redis to start
depends_on:
db:
condition: service_healthy
redis:
condition: service_healthy
# colorizes output
tty: true
db:
image: postgres:14-alpine
# matches config in config-test.json
environment:
POSTGRES_DB: test
POSTGRES_USER: test
POSTGRES_PASSWORD: test
healthcheck:
test: ['CMD-SHELL', 'pg_isready -U test']
interval: 1s
timeout: 3s
retries: 5
redis:
image: redis:7-alpine
healthcheck:
test: ['CMD-SHELL', 'redis-cli ping']
interval: 1s
timeout: 3s
retries: 5
volumes:
node_modules: