-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
37 lines (35 loc) · 853 Bytes
/
docker-compose.yml
File metadata and controls
37 lines (35 loc) · 853 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
services:
backend:
build:
context: ./backend
environment:
- PYTHONUNBUFFERED=1
container_name: django-backend
command: python manage.py runserver 0.0.0.0:8000
volumes:
- ./backend:/app
ports:
- "8000:8000"
env_file:
- .env
depends_on:
db:
condition: service_healthy # Waits for PostgreSQL to be ready
db:
image: postgres:14
container_name: postgres-db
environment:
POSTGRES_USER: myuser
POSTGRES_PASSWORD: mypassword
POSTGRES_DB: timemanager_db
volumes:
- postgres_data:/var/lib/postgresql/data
ports:
- "5432:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U myuser -d timemanager_db"]
interval: 5s
retries: 5
start_period: 10s # Allow some time for DB to start
volumes:
postgres_data: