-
Notifications
You must be signed in to change notification settings - Fork 11
/
docker-compose.yaml
51 lines (50 loc) · 1.38 KB
/
docker-compose.yaml
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
services:
backend:
container_name: nest-backend
command: >
bash -c "
poetry install --no-root &&
poetry run python manage.py migrate &&
poetry run python manage.py runserver 0.0.0.0:8000 &
poetry run python manage.py run_slack_bot;
wait
"
build:
context: ./backend
dockerfile: Dockerfile.local
depends_on:
db:
condition: service_healthy
env_file: backend/.env/local
environment:
DJANGO_DB_HOST: ${DJANGO_DB_HOST:-db}
DJANGO_DB_NAME: ${DJANGO_DB_NAME:-nest_db_dev}
DJANGO_DB_PASSWORD: ${DJANGO_DB_PASSWORD:-nest_user_dev_password}
DJANGO_DB_PORT: ${DJANGO_DB_PORT:-5432}
DJANGO_DB_USER: ${DJANGO_DB_USER:-nest_user_dev}
ports:
- '127.0.0.1:8000:8000'
volumes:
- ./backend:/home/owasp
db:
container_name: nest-db
image: postgres:16.4
environment:
POSTGRES_DB: ${DJANGO_DB_NAME:-nest_db_dev}
POSTGRES_PASSWORD: ${DJANGO_DB_PASSWORD:-nest_user_dev_password}
POSTGRES_USER: ${DJANGO_DB_USER:-nest_user_dev}
healthcheck:
test:
[
'CMD',
'pg_isready',
'-U',
'${DJANGO_DB_USER:-nest_user_dev}',
'-d',
'${DJANGO_DB_NAME:-nest_db_dev}',
]
interval: 5s
timeout: 5s
retries: 5
volumes:
- ./volumes/db:/var/lib/postgresql/data