kers/docker-compose.yml
2020-07-24 23:27:48 +02:00

61 lines
1.4 KiB
YAML

version: '3'
services:
web:
build: .
ports:
- "8000:8000"
environment:
DATABASE_HOST: 'database'
CELERY_BROKER: 'redis://redis:6379/0'
CELERY_BACKEND: 'redis://redis:6379/1'
depends_on:
- database
command: >
sh -c "./scripts/wait_for_service database 3306 &&
python manage.py migrate &&
python manage.py runserver 0.0.0.0:8000"
celery-worker:
build: .
environment:
DATABASE_HOST: 'database'
CELERY_BROKER: 'redis://redis:6379/0'
CELERY_BACKEND: 'redis://redis:6379/1'
depends_on:
- web
- redis
command: >
sh -c "./scripts/wait_for_service web 8000 &&
celery -A KeRS worker -l info"
celery-beat:
build: .
environment:
DATABASE_HOST: 'database'
CELERY_BROKER: 'redis://redis:6379/0'
CELERY_BACKEND: 'redis://redis:6379/1'
depends_on:
- web
- redis
command: >
sh -c "./scripts/wait_for_service web 8000 &&
celery -A KeRS beat -l info --scheduler django_celery_beat.schedulers:DatabaseScheduler"
redis:
image: redis:latest
# Db stuff
database:
image: mariadb:10.5.4-focal
environment:
MYSQL_ROOT_PASSWORD: example
MYSQL_DATABASE: kers
MYSQL_USER: kers
MYSQL_PASSWORD: kers
# DB visual panel
adminer:
image: adminer:latest
depends_on:
- database
ports:
- 8080:8080