Files
fastapi_best_architecture/backend.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

27 lines
899 B
Docker
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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/*
# 某些包可能存在同步不及时导致安装失败的情况可更改为官方源https://pypi.org/simple
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/fastapi_server
COPY ./deploy/fastapi_server.conf /etc/supervisor/conf.d/
EXPOSE 8001
CMD ["uvicorn", "backend.app.main:app", "--host", "127.0.0.1", "--port", "8000"]