-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
34 lines (32 loc) · 814 Bytes
/
docker-compose.yml
File metadata and controls
34 lines (32 loc) · 814 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
34
version: '3.8'
volumes:
pg_data:
services:
app:
build:
context: .
dockerfile: Dockerfile.production
image: haliont/javascript-fastify-blog
command: ["npm", "test"]
environment:
DATABASE_HOST: $DATABASE_HOST
DATABASE_PORT: $DATABASE_PORT
DATABASE_NAME: $DATABASE_NAME
DATABASE_USERNAME: $DATABASE_USERNAME
DATABASE_PASSWORD: $DATABASE_PASSWORD
depends_on:
db:
condition: service_healthy
db:
image: postgres:latest
environment:
POSTGRES_DB: $DATABASE_NAME
POSTGRES_USER: $DATABASE_USERNAME
POSTGRES_PASSWORD: $DATABASE_PASSWORD
volumes:
- pg_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 10s
timeout: 5s
retries: 5