docker-compose.yml
version: "3.7"
services:
db:
image: postgres
volumes:
- postgresql:/var/lib/postgresql/data
environment:
- POSTGRES_DB=postgres
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
web:
tty: true
stdin_open: true
build: .
command: python manage.py runserver 0.0.0.0:8000
env_file:
- .env
environment:
- DATABASE_URL=postgresql://postgres:postgres@db/postgres
- DATABASE_DISABLE_SSL=true
- REDIS_URL=rediss://redis
volumes:
- .:/code
ports:
- "8000:8000"
depends_on:
- db
redis:
image: redis
celery:
tty: true
stdin_open: true
build: .
command: celery -A api.tasks worker --beat -l INFO --scheduler django_celery_beat.schedulers:DatabaseScheduler
env_file:
- .env
environment:
- DATABASE_URL=postgresql://postgres:postgres@db/postgres
- DATABASE_DISABLE_SSL=true
- REDIS_URL=rediss://redis
volumes:
- .:/code
depends_on:
- db
- redis
volumes:
postgresql: