-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdocker-compose.yml
43 lines (41 loc) · 1.05 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
version: '3.4'
services:
api:
build:
context: .
image: class-assistant-api
container_name: class-assistant-api
restart: always
volumes:
- .:/app
ports:
- '5000:5000'
environment:
PostgreSqlConnectionString: "Host=${DB_HOST};Port=5432;Username=${POSTGRES_USER};Password=${POSTGRES_PASSWORD};Database=${POSTGRES_DB};"
healthcheck:
test: ["CMD-SHELL", "curl -f http://localhost:5000/ || exit 1"]
start_period: 60s
interval: 30s
timeout: 5s
retries: 5
links:
- db
depends_on:
- db
db:
image: postgres:12.4-alpine
container_name: class-assistant-db
restart: always
ports:
- 5432:5432
volumes:
- ./db-data:/var/lib/postgresql/data
environment:
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- POSTGRES_DB=${POSTGRES_DB}
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 10s
timeout: 5s
retries: 5