Files
fastapi_best_architecture/celery.dockerfile
Wu Clan 275f9e5e93 Replace APScheduler to Celery asynchronous tasks (#229)
* Replace APScheduler to Celery task

* black format

* Add celery to run the script

* Update celery usage to README

* Update test task

* Add celery rabbitmq broker

* Fix dockerfiles

* Add task interface access authorization

* Update celery deploy run

* Fix dockerfiles

* Fix supervisor conf

* Update celery broker default is redis

* Force the pro env to use rabbitmq

* Update the task interface

* Add celery beat README description

* Update warning text style

* Revoke the default config comment content of the supervisor
2023-10-27 11:59:46 +08:00

28 lines
755 B
Docker

FROM python:3.10-slim
WORKDIR /fba
COPY . .
RUN sed -i 's/deb.debian.org/mirrors.ustc.edu.cn/g' /etc/apt/sources.list.d/debian.sources \
&& sed -i 's|security.debian.org/debian-security|mirrors.ustc.edu.cn/debian-security|g' /etc/apt/sources.list.d/debian.sources
RUN apt-get update \
&& apt-get install -y --no-install-recommends gcc python3-dev \
&& rm -rf /var/lib/apt/lists/*
RUN pip install --upgrade pip -i https://mirrors.aliyun.com/pypi/simple \
&& pip install --no-cache-dir -r requirements.txt -i https://mirrors.aliyun.com/pypi/simple
ENV TZ = Asia/Shanghai
RUN mkdir -p /var/log/celery
COPY ./deploy/celery.conf /etc/supervisor/conf.d/
WORKDIR /fba/backend/app
RUN chmod +x celery-start.sh
CMD ["./celery-start.sh"]