-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
40 lines (37 loc) · 1.26 KB
/
Copy pathdocker-compose.yml
File metadata and controls
40 lines (37 loc) · 1.26 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
services:
django:
build:
context: .
dockerfile: Dockerfile.django
image: rush_admin/django
volumes:
- .:/rush_admin # bind mount for live reload
- venv:/rush_admin/.venv # preserve venv from image
- frontend_node_modules:/rush_admin/frontend/node_modules # preserve node_modules from image
depends_on:
- postgres
env_file:
- .env
environment:
- POSTGRES_DATABASE_HOST=postgres # db container service defined below
- GDAL_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu/libgdal.so.37 # configure GDAL env path for django (should be stable since we are using a fixed GDAL base image)
command: >
sh -c "poetry run python manage.py makemigrations &&
poetry run python manage.py migrate &&
poetry run python manage.py runserver 0.0.0.0:8000"
ports:
- "8000:8000"
postgres:
image: postgis/postgis:18-3.6
environment:
- POSTGRES_DB=${POSTGRES_DATABASE_NAME}
- POSTGRES_USER=${POSTGRES_DATABASE_USERNAME}
- POSTGRES_PASSWORD=${POSTGRES_DATABASE_PASSWORD}
volumes:
- pgdata:/var/lib/postgresql
ports:
- "5432:5432"
volumes:
venv:
frontend_node_modules:
pgdata: