forked from creativecommons/legaldb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
42 lines (38 loc) · 1.04 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
# Also see:
# Dockerfile
#
# https://docs.docker.com/compose/compose-file/compose-file-v2/
version: "2.4"
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
environment:
- DJANGO_DATABASE_HOST=db
- DJANGO_DATABASE_PASSWORD=${DJANGO_DATABASE_PASSWORD:-postgres}
depends_on:
- db
ports:
- 8000:8000
restart: always
volumes:
- ./:/legaldb
db:
env_file:
- .env
environment:
- POSTGRES_DB=${DJANGO_DATABASE_NAME}
- POSTGRES_USER=${DJANGO_DATABASE_USER}
- POSTGRES_PASSWORD=${DJANGO_DATABASE_PASSWORD:-postgres}
# 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:15-alpine
restart: always
volumes:
- ./tmp/pgdata/:/var/lib/postgresql/data