-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
43 lines (40 loc) · 933 Bytes
/
Copy pathdocker-compose.yml
File metadata and controls
43 lines (40 loc) · 933 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
35
36
37
38
39
40
41
42
43
services:
db:
image: postgres:16-alpine
container_name: student-access-db
environment:
POSTGRES_DB: kmk
POSTGRES_USER: kmk_app
POSTGRES_PASSWORD: kmk_password
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
- ./db/init.sql:/docker-entrypoint-initdb.d/init.sql:ro
app:
build:
context: ./app
container_name: student-access-app
env_file:
- .env
environment:
DB_HOST: student-access-db
depends_on:
- db
expose:
- "8000"
healthcheck:
test: ["CMD-SHELL", "python -c \"import urllib.request; urllib.request.urlopen('http://localhost:8000/health').read()\" || exit 1"]
interval: 10s
timeout: 3s
retries: 3
nginx:
build:
context: ./nginx
container_name: student-access-nginx
depends_on:
- app
ports:
- "8080:80"
volumes:
postgres_data: