-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
56 lines (52 loc) · 1.2 KB
/
docker-compose.yml
File metadata and controls
56 lines (52 loc) · 1.2 KB
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
services:
db:
restart: unless-stopped
image: postgres:17
container_name: thesis-db
environment:
POSTGRES_DB: ${POSTGRES_DB:-thesis}
POSTGRES_USER: ${POSTGRES_USER:-thesis_user}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-thesis_pass}
volumes:
- pgdata:/var/lib/postgresql/data
- ./db/init:/docker-entrypoint-initdb.d
healthcheck:
test: ["CMD-SHELL", "pg_isready -U $$POSTGRES_USER -d $$POSTGRES_DB -h localhost"]
interval: 10s
timeout: 5s
retries: 10
networks:
- app-net
api:
restart: unless-stopped
build:
context: .
dockerfile: Dockerfile.api
container_name: thesis-api
depends_on:
db:
condition: service_healthy
environment:
DATABASE_URL: ${DATABASE_URL:-postgresql+psycopg://thesis_user:thesis_pass@db:5432/thesis}
PYTHONUNBUFFERED: "1"
expose:
- "5000"
networks:
- app-net
nginx:
restart: unless-stopped
build:
context: .
dockerfile: Dockerfile.nginx
container_name: thesis-nginx
depends_on:
- api
ports:
- "80:80"
networks:
- app-net
volumes:
pgdata:
networks:
app-net:
driver: bridge