Files
fastapi-best-architecture/backend/celery.dockerfile
T
Meepoljdx 78dad3021a Add postgresql database support (#475)
* feat: add postgresql db supports

* change: change mysql conn str create way

* fix: Modify the default alembic migration file to meet multi-database support

* Update settings and lint

* update models

* Simplify database config

* Simplify the get db method

* Update create db url

* Updated model type adaptation

* Update sql scripts

* Fix models type

* Adaptation to postgresql code generation

* Update README.md

* Fix alembic file template

* Update docker scripts
2024-12-25 22:04:04 +08:00

33 lines
1019 B
Docker

FROM python:3.10-slim
SHELL ["/bin/bash", "-c"]
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
&& pip install --upgrade pip -i https://mirrors.aliyun.com/pypi/simple \
&& pip install -r backend/requirements.txt -i https://mirrors.aliyun.com/pypi/simple \
&& pip install gunicorn aio_pika supervisor wait-for-it -i https://mirrors.aliyun.com/pypi/simple
ENV TZ="Asia/Shanghai"
RUN mkdir -p /var/log/celery
COPY deploy/backend/celery.conf /etc/supervisor/conf.d/
WORKDIR /fba/backend/
RUN chmod +x celery-start.sh
EXPOSE 8555
CMD ["./celery-start.sh"]