-
-
Notifications
You must be signed in to change notification settings - Fork 30
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
45 lines (43 loc) · 1.02 KB
/
docker-compose.yml
File metadata and controls
45 lines (43 loc) · 1.02 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
services:
db:
image: postgres:17-alpine
environment:
POSTGRES_DB: operationcode
POSTGRES_USER: operationcode
POSTGRES_PASSWORD: operationcode
volumes:
- postgres_data:/var/lib/postgresql/data
ports:
- "5432:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U operationcode"]
interval: 5s
timeout: 5s
retries: 5
backend:
build:
context: .
target: development
env_file:
- .env
environment:
# Override .env database settings to use PostgreSQL container
- DB_ENGINE=django.db.backends.postgresql
- DB_NAME=operationcode
- DB_USER=operationcode
- DB_PASSWORD=operationcode
- DB_HOST=db
- DB_PORT=5432
ports:
- "8000:8000"
volumes:
- ./src:/app/src
depends_on:
db:
condition: service_healthy
working_dir: /app/src
command: >
sh -c "python manage.py migrate &&
python manage.py runserver 0.0.0.0:8000"
volumes:
postgres_data: