--- version: "3.8" x-env: &env environment: CELERY_BROKER_URL: "redis://redis:6379" CELERY_RESULT_BACKEND: "redis://redis:6379" FLASK_APP: "wsgi:app" FLASK_ENV: "development" REDIS_HOST: "redis" REDIS_PORT: "6379" REDIS_SESSION_DB: "0" services: flask: build: . <<: *env ports: - "5000:5000" command: | poetry run flask run --host 0.0.0.0 volumes: - "./:/magic_app/" celery: build: . <<: *env command: | poetry run celery worker -A celworker.celery -B -l debug volumes: - "./:/magic_app/" redis: image: redis:alpine