forked from creativecommons/legaldb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
46 lines (43 loc) · 1.37 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
# Also see:
# Dockerfile
#
# https://docs.docker.com/compose/compose-file/
services:
app:
build:
context: .
command: >
bash -c "while !</dev/tcp/db/${DJANGO_DATABASE_PORT:?}; do sleep 1; done;
./manage.py runserver 0.0.0.0:8000"
env_file:
# .env should be copied from .env.template and configured
- .env
environment:
- DJANGO_SECRET_KEY=${DJANGO_SECRET_KEY:?}
- DJANGO_DATABASE_HOST=db
- DJANGO_DATABASE_PASSWORD=${DJANGO_DATABASE_PASSWORD:-postgres}
- DJANGO_SUPERUSER_USERNAME=${DJANGO_SUPERUSER_USERNAME:?}
- DJANGO_SUPERUSER_EMAIL=${DJANGO_SUPERUSER_EMAIL:?}
- DJANGO_SUPERUSER_PASSWORD=${DJANGO_SUPERUSER_PASSWORD:?}
depends_on:
- db
ports:
- 8000:8000
restart: always
volumes:
- ./:/legaldb
db:
env_file:
# .env should be copied from .env.template and configured
- .env
environment:
- POSTGRES_DB=${DJANGO_DATABASE_NAME:?}
- POSTGRES_PASSWORD=${DJANGO_DATABASE_PASSWORD:-postgres}
- POSTGRES_USER=${DJANGO_DATABASE_USER:?}
# https://hub.docker.com/_/postgres
# https://devcenter.heroku.com/articles/heroku-postgres-version-support
# Match version to Heroku app. Keep in sync with .github/workflows/main.yml
image: postgres:16-alpine
restart: always
volumes:
- ./tmp/pgdata/:/var/lib/postgresql/data