forked from alan-turing-institute/AutSPACEs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
64 lines (57 loc) · 1.47 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
---
# 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.1"
services:
db:
image: "postgres:15.2-alpine"
restart: unless-stopped
volumes:
- pgdata:/var/lib/postgresql/data
networks:
- webnet
env_file: ./config/.env
web:
<<: &web
# Image name is changed in production:
image: "autspaces:dev"
build:
target: development_build
context: .
dockerfile: ./docker/django/Dockerfile
args:
DJANGO_ENV: development
cache_from:
- "autspaces:dev"
- "autspaces:latest"
- "*"
volumes:
- django-static:/var/www/django/static
depends_on:
- db
networks:
- webnet
env_file: ./config/.env
environment:
DJANGO_DATABASE_HOST: db
command: python -Wd manage.py runserver 0.0.0.0:8000
healthcheck:
test: |
/usr/bin/test $$(
/usr/bin/curl --fail http://localhost:8000/health/?format=json
--write-out "%{http_code}" --silent --output /dev/null
) -eq 200
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
networks:
# Network for your internals, use it by default:
webnet:
volumes:
pgdata:
django-static: