-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocker-compose.yml
68 lines (62 loc) · 1.58 KB
/
docker-compose.yml
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
57
58
59
60
61
62
63
64
65
66
67
68
---
# Default compose file for development and production.
# Should be used directly in development.
# Automatically loads `docker-compose.override.yml` if it exists.
# No extra steps required.
# Should be used together with `docker/docker-compose.prod.yml`
# in production.
version: "3.6"
services:
db:
image: postgres:12
restart: unless-stopped
volumes:
- pgdata:/var/lib/postgresql/data
env_file: ./config/.env
ports:
- "5432:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U lba_user legal_basis_api"]
interval: 5s
timeout: 5s
retries: 5
web:
<<: &web
build:
context: .
dockerfile: ./docker/django/Dockerfile
args:
DJANGO_ENV: development
volumes:
- django-static:/var/www/django/static
depends_on:
- db
- redis
env_file: ./config/.env
environment:
DJANGO_DATABASE_HOST: db
CRYPTOGRAPHY_DONT_BUILD_RUST: 1
command: >
sh -c "python manage.py collectstatic --noinput &&
python manage.py migrate &&
python manage.py runserver 0.0.0.0:8000"
healthcheck:
test: curl --fail http://localhost:8000/health/?format=json || exit 1
interval: 10s
timeout: 5s
retries: 5
start_period: 10s
redis:
image: redis:alpine
restart: on-failure
ports:
- "6379:6379"
# This task is an example of how to extend existing ones:
# some_worker:
# <<: *web
# command: python manage.py worker_process
volumes:
pgdata:
django-static:
django-media:
django-locale: