56 lines
1.3 KiB
YAML
56 lines
1.3 KiB
YAML
version: '3'
|
|
services:
|
|
web:
|
|
build: .
|
|
ports:
|
|
- "8000:8000"
|
|
environment:
|
|
DATABASE_HOST: 'db'
|
|
CELERY_BROKER: 'redis://redis:6379/0'
|
|
CELERY_BACKEND: 'redis://redis:6379/1'
|
|
depends_on:
|
|
- db
|
|
command: >
|
|
sh -c "sleep 5 &&
|
|
python manage.py migrate &&
|
|
python manage.py runserver 0.0.0.0:8000"
|
|
celery-worker:
|
|
build: .
|
|
environment:
|
|
DATABASE_HOST: 'db'
|
|
CELERY_BROKER: 'redis://redis:6379/0'
|
|
CELERY_BACKEND: 'redis://redis:6379/1'
|
|
depends_on:
|
|
- web
|
|
- redis
|
|
command: >
|
|
sh -c "celery -A KeRS worker -l info"
|
|
celery-beat:
|
|
build: .
|
|
environment:
|
|
DATABASE_HOST: 'db'
|
|
CELERY_BROKER: 'redis://redis:6379/0'
|
|
CELERY_BACKEND: 'redis://redis:6379/1'
|
|
depends_on:
|
|
- web
|
|
- redis
|
|
command: >
|
|
sh -c "celery -A KeRS beat -l info --scheduler django_celery_beat.schedulers:DatabaseScheduler"
|
|
redis:
|
|
image: redis
|
|
# Db stuff
|
|
db:
|
|
image: mysql:8.0.21
|
|
command: --default-authentication-plugin=mysql_native_password
|
|
environment:
|
|
MYSQL_ROOT_PASSWORD: example
|
|
MYSQL_DATABASE: kers
|
|
MYSQL_USER: kers
|
|
MYSQL_PASSWORD: kers
|
|
# DB visual panel
|
|
adminer:
|
|
image: adminer:latest
|
|
depends_on:
|
|
- db
|
|
ports:
|
|
- 8080:8080
|