cleaned up docker-compose files

This commit is contained in:
gw3000 2023-07-21 22:42:33 +02:00
parent 34d05ea7be
commit 2157ed5a97
2 changed files with 13 additions and 6 deletions

View file

@ -3,7 +3,12 @@ version: '3.8'
services:
web:
build: ./app
command: bash -c 'while !</dev/tcp/db/5432; do sleep 1; done; python manage.py makemigrations; python manage.py migrate; python manage.py runserver 0.0.0.0:8000'
command: >
bash -c 'while !</dev/tcp/db/5432; do sleep 1; done;
python manage.py makemigrations;
python manage.py migrate;
python manage.py collectstatic --no-input --no-post-process;
python manage.py runserver 0.0.0.0:8000'
volumes:
- ./app:/app
expose:
@ -17,13 +22,12 @@ services:
- "DB_PORT=${DB_PORT}"
- "DB_USER=${DB_USER}"
- "DEBUG=${DEBUG}"
- "DJANGO_ALLOWED_HOSTS=${DJANGO_ALLOWED_HOSTS}"
- "SECRET_KEY=${SECRET_KEY}"
depends_on:
- db
labels:
- "traefik.enable=true"
- "traefik.http.routers.django.rule=Host(`${DJANGO_ALLOWED_HOSTS}`)"
- "traefik.http.routers.django.rule=Host(`${ALLOWED_HOSTS}`)"
db:
image: postgres:15-alpine
volumes: