-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.test.yml
More file actions
43 lines (39 loc) · 968 Bytes
/
Copy pathdocker-compose.test.yml
File metadata and controls
43 lines (39 loc) · 968 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:
web:
build:
context: .
dockerfile: Dockerfile
working_dir: /app
environment:
- PYTHONPATH=/app/src
- DJANGO_ENV=test
- SECRET_KEY=django-insecure-test-key
- DB_HOST=db
- DB_NAME=test_db
- DB_USER=test_user
- DB_PASSWORD=test_pass
- DB_PORT=5432
- SITE_URL=127.0.0.1:8000
- DEFAULT_FROM_EMAIL="noreply@mydomain.com"
command: sh -c "python src/manage.py migrate --noinput && pytest --cov=src --cov-report=term-missing"
depends_on:
db:
condition: service_healthy
networks:
- backend
db:
image: postgres:16-bookworm
environment:
POSTGRES_DB: test_db
POSTGRES_USER: test_user
POSTGRES_PASSWORD: test_pass
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U test_user -d test_db" ]
interval: 5s
timeout: 3s
retries: 5
networks:
- backend
networks:
backend:
driver: bridge