-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.test.yml
48 lines (47 loc) · 1.24 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
46
47
48
version: "3.7"
services:
todoapp_redis:
image: redis
container_name: todoapp_redis
networks:
- webnet
todoapp_db:
container_name: todoapp_db
image: postgres
networks:
- webnet
# постгре выполняет скрипты, замаунченые в этом каталоге
volumes:
- ./server/pg-init-scripts:/docker-entrypoint-initdb.d
environment:
# POSTGRES_DB: ${DBNAME}
POSTGRES_MULTIPLE_DATABASES: ${DBNAME},${DBNAME}_test
POSTGRES_USER: ${DBUSER}
POSTGRES_PASSWORD: ${DBPASSWORD}
todoapp_test_server:
build:
context: ./server
dockerfile: Dockerfile
target: unit-tests
container_name: todoapp_test_server
networks:
- webnet
environment:
DB_HOST: todoapp_db
REDIS_HOST: todoapp_redis
volumes:
# для хотрелоада
- ./server/src:/home/node/app/src
# для того чтоб работал jest --watch
- ./.git:/home/node/.git
depends_on:
- todoapp_db
- todoapp_redis
env_file:
- .env
command: ["npm", "run", "test:watch"]
# эти две опции делают логи цветными
tty: true
stdin_open: false
networks:
webnet: