-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
44 lines (44 loc) · 1022 Bytes
/
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
services:
app:
container_name: "vendor-machine-api"
restart: on-failure
build:
context: .
dockerfile: Dockerfile
networks:
- vending-machine-network
ports:
- "3000:3000"
volumes:
- .:/usr/src/app
environment:
DATABASE_URI: ${DATABASE_URI:-postgresql://postgres:password@db:5432/postgres}
SECRET_KEY: ${SECRET_KEY:-mysecretkey}
depends_on:
db:
condition: service_healthy
db:
image: postgres
container_name: "vending-machine-db"
restart: on-failure
networks:
- vending-machine-network
ports:
- "5432:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 5s
timeout: 5s
retries: 5
volumes:
- db-data:/var/lib/postgresql/data
environment:
POSTGRES_USER: ${DB_USER:-postgres}
POSTGRES_PASSWORD: ${DB_PASSWORD:-password}
networks:
vending-machine-network:
driver: bridge
volumes:
app-data:
db-data:
app-node-modules: