-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
69 lines (66 loc) · 2.15 KB
/
docker-compose.yml
File metadata and controls
69 lines (66 loc) · 2.15 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# For use in development only. Starts two containers - one for MMT, one for postgres
# with volumes for the /app directory and the postgres data. /app dir mapped means that
# changes to the code reloads MMT.
services:
db:
image: postgis/postgis:17-3.5-alpine
volumes:
- postgres_data:/var/lib/postgresql
- backups:/backups
environment:
- POSTGRES_USER=${DJANGO_DB_USER}
- POSTGRES_DB=${DJANGO_DB_NAME}
- POSTGRES_PASSWORD=${DJANGO_DB_PASSWORD}
- ALLOW_IP_RANGE=0.0.0.0/0
ports:
- 5433:5432
env_file:
- .env
platform: linux/amd64
healthcheck:
test: ["CMD-SHELL", "pg_isready --username=${DJANGO_DB_USER} --dbname=${DJANGO_DB_NAME}"]
start_period: 10s
restart: always
memorymaptoolkit:
image: memorymaptoolkit
build:
context: .
dockerfile: ./Dockerfile
volumes:
- static:/app/static
- media:/app/media
- backups:/app/backups
- .:/app
depends_on:
db:
condition: service_healthy
command: >
bash -c "
python manage.py migrate && \
(python manage.py createsuperuser --noinput || echo 'Assuming preexisting user and continuing...') && \
python manage.py collectstatic --noinput && \
python manage.py runserver 0.0.0.0:8000
"
ports:
- 8000:8000
env_file:
- .env
environment:
- DJANGO_DB_USER=${DJANGO_DB_USER}
- DJANGO_DB_NAME=${DJANGO_DB_NAME}
- DJANGO_DB_PASSWORD=${DJANGO_DB_PASSWORD}
- DJANGO_SECRET_KEY=${DJANGO_SECRET_KEY}
- DJANGO_ALLOWED_HOSTS=${DJANGO_ALLOWED_HOSTS}
- DJANGO_SECURE_SSL_HOST=${DJANGO_SECURE_SSL_HOST}
- DJANGO_SESSION_COOKIE_SECURE=${DJANGO_SESSION_COOKIE_SECURE}
- DJANGO_CSRF_COOKIE_SECURE=${DJANGO_CSRF_COOKIE_SECURE}
- DJANGO_DB_HOST=${DJANGO_DB_HOST}
- DJANGO_SETTINGS_MODULE=memorymap_toolkit.settings.local
healthcheck:
test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:8000')"]
restart: always
volumes:
postgres_data:
static:
media:
backups: