forked from naturnd-rush/rush-cms-django
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
36 lines (34 loc) · 1.19 KB
/
docker-compose.yml
File metadata and controls
36 lines (34 loc) · 1.19 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
services:
django:
build:
context: .
dockerfile: Dockerfile.django
# args:
# # For calling django makemigrations and migrate during the build stage (.env and environment are not injected by Docker until container runtime).
# DJANGO_SECRET_KEY: ${DJANGO_SECRET_KEY}
# DJANGO_DEBUG: ${DJANGO_DEBUG}
image: rush_admin/django
volumes:
- .:/app
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"
postgres:
build:
context: .
dockerfile: Dockerfile.postgres
image: rush_admin/postgres
environment:
- POSTGRES_DB=${POSTGRES_DATABASE_NAME}
- POSTGRES_USER=${POSTGRES_DATABASE_USERNAME}
- POSTGRES_PASSWORD=${POSTGRES_DATABASE_PASSWORD}
ports:
- "5432:5432"