-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest-docker-compose.yml
More file actions
33 lines (30 loc) · 848 Bytes
/
test-docker-compose.yml
File metadata and controls
33 lines (30 loc) · 848 Bytes
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
version: '3'
services:
test-database:
image: "postgres" # use latest official postgres version
env_file:
- ./.env # configure postgres
volumes:
- ./database-data:/var/lib/postgresql/data/ # persist data even if container shuts down
ports:
- 5432:5432
# Set health checks to wait until postgres has started
healthcheck:
test: ["CMD-SHELL", "pg_isready"]
interval: 10s
timeout: 5s
retries: 5
test-server:
build:
context: .
dockerfile: Dockerfile.test
env_file:
- ./.env
depends_on:
- test-database
volumes:
- ./node:/usr/src/app/node
- ./package.json:/usr/src/app/package.json
- ./package-lock.json:/usr/src/app/package-lock.json
volumes:
database-data: {} # named volumes can be managed easier using docker-compose