-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
58 lines (54 loc) · 1.16 KB
/
docker-compose.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
49
50
51
52
53
54
55
56
57
58
version: '3.8'
services:
nest_app:
container_name: nest_app
build:
context: ./.
dockerfile: Dockerfile
ports:
- 8794:8794
expose:
- 8794
depends_on:
- prism_migration
- postgres
volumes:
- ./src:/app/src
nest_unit_tests:
build:
context: ./.
dockerfile: Dockerfile
command: npm run test
prism_migration:
build:
context: ./.
dockerfile: ./prisma/Dockerfile
depends_on:
- postgres
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=password
- HOST=postgres_container
- PORT=5432
- PASSWORD=password
- DATABASE=mydb
- PG_USER=postgres
- DATABASE_URL=postgresql://${PG_USER}:${PASSWORD}@postgres_container:${PORT}/${DATABASE}
postgres:
container_name: postgres_container
build:
context: ./db
dockerfile: Dockerfile
ports:
- 5432:5432
expose:
- 5432
restart: always
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=password
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 5s
timeout: 5s
retries: 5