backend/docker-compose.yml

42 lines
901 B
YAML

version: "3.9"
services:
web:
build: .
ports:
- "8000:8000"
volumes:
- .:/code
command: >
sh -c "python3 manage.py makemigrations &&
python3 manage.py migrate --noinput &&
python3 manage.py loaddata paragraphtypes.json &&
python3 manage.py runserver 0.0.0.0:8000"
depends_on:
- db
db:
image: postgres:14-alpine
volumes:
- postgres_data:/var/lib/postgresql/data/
ports:
- "5432:5432"
environment:
- "POSTGRES_HOST_AUTH_METHOD=trust"
- "POSTGRES_DB=db"
- "POSTGRES_USER=postgres"
- "POSTGRES_PASSWORD=postgres"
redis:
image: redis:alpine
celery:
restart: always
build:
context: .
command: celery -A conf worker --loglevel=INFO
volumes:
- ./app:/app
depends_on:
- db
- redis
- web
volumes:
postgres_data: