-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.yml
57 lines (56 loc) · 1.28 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
version: '3.8'
services:
db:
image: postgres:14.1-alpine
hostname: db
user: postgres
ports:
- "5432:5432"
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
- POSTGRES_DB=requests
- PGDATA=/var/lib/postgresql/data/
volumes:
- db-data:/var/lib/postgresql/data
- db-tmp:/var/lib/postgresql/tmp
restart: always
command: postgres -c logging_collector=on -c log_connections=yes -c log_destination='stderr' -c stats_temp_directory=/var/lib/postgresql/tmp
networks:
- requestsstack
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 5s
timeout: 5s
retries: 3
api:
container_name: api
build:
context: ./
dockerfile: Dockerfile
image: rapt:latest
command: uvicorn app.main:app --reload --host 0.0.0.0 --port 8000
restart: on-failure
networks:
- requestsstack
ports:
- "8000:8000"
depends_on:
db:
condition: service_healthy
environment:
DB_HOST: db
DB_PORT: 5432
DB_USER: postgres
DB_PASSWORD: postgres
DB_NAME: requests
links:
- db
volumes:
db-data:
name: db-data
db-tmp:
name: db-tmp
networks:
requestsstack:
driver: bridge