mirror of
https://github.com/fastapi-practices/fastapi_best_architecture.git
synced 2025-08-15 20:26:34 +08:00

* 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
28 lines
755 B
Docker
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"]
|