File tree Expand file tree Collapse file tree 5 files changed +26
-23
lines changed
deploy/backend/docker-compose Expand file tree Collapse file tree 5 files changed +26
-23
lines changed Original file line number Diff line number Diff line change 11FROM python:3.10-slim
22
3+ SHELL ["/bin/bash" , "-c" ]
4+
35WORKDIR /fba
46
57COPY . .
@@ -9,13 +11,13 @@ RUN sed -i 's/deb.debian.org/mirrors.ustc.edu.cn/g' /etc/apt/sources.list.d/debi
911
1012RUN apt-get update \
1113 && apt-get install -y --no-install-recommends gcc python3-dev \
12- && rm -rf /var/lib/apt/lists/*
13-
14- # 某些包可能存在同步不及时导致安装失败的情况,可更改为官方源: https://pypi.org/ simple
15- RUN curl -LsSf https://astral.sh/uv/install.sh | sh \
16- && uv sync --group server --default-index https://mirrors.aliyun.com/pypi/simple
14+ && rm -rf /var/lib/apt/lists/* \
15+ # 某些包可能存在同步不及时导致安装失败的情况,可更改为官方源:https://pypi.org/simple
16+ && pip install --upgrade pip -i https://mirrors.aliyun.com/pypi/ simple \
17+ && pip install -r backend/requirements.txt -i https://mirrors.aliyun.com/pypi/simple \
18+ && pip install gunicorn aio_pika supervisor wait-for-it -i https://mirrors.aliyun.com/pypi/simple
1719
18- ENV TZ = Asia/Shanghai
20+ ENV TZ= " Asia/Shanghai"
1921
2022RUN mkdir -p /var/log/fastapi_server
2123
Original file line number Diff line number Diff line change 11FROM python:3.10-slim
22
3+ SHELL ["/bin/bash" , "-c" ]
4+
35WORKDIR /fba
46
57COPY . .
@@ -10,11 +12,12 @@ RUN sed -i 's/deb.debian.org/mirrors.ustc.edu.cn/g' /etc/apt/sources.list.d/debi
1012RUN apt-get update \
1113 && apt-get install -y --no-install-recommends gcc python3-dev \
1214 && rm -rf /var/lib/apt/lists/* \
15+ # 某些包可能存在同步不及时导致安装失败的情况,可更改为官方源:https://pypi.org/simple
16+ && pip install --upgrade pip -i https://mirrors.aliyun.com/pypi/simple \
17+ && pip install -r backend/requirements.txt -i https://mirrors.aliyun.com/pypi/simple \
18+ && pip install gunicorn aio_pika supervisor wait-for-it -i https://mirrors.aliyun.com/pypi/simple
1319
14- RUN curl -LsSf https://astral.sh/uv/install.sh | sh \
15- && uv sync --group server --default-index https://mirrors.aliyun.com/pypi/simple
16-
17- ENV TZ = Asia/Shanghai
20+ ENV TZ="Asia/Shanghai"
1821
1922RUN mkdir -p /var/log/celery
2023
Original file line number Diff line number Diff line change 11# Docker
22DOCKER_MYSQL_MAP_PORT=13306
3+ DOCKER_POSTGRES_MAP_PORT=15432
34DOCKER_REDIS_MAP_PORT=16379
Original file line number Diff line number Diff line change 11# Env: dev、pro
22ENVIRONMENT='dev'
3- # MySQL
4- MYSQL_HOST='fba_mysql'
5- MYSQL_PORT=3306
6- MYSQL_USER='root'
7- MYSQL_PASSWORD='123456'
3+ # Database
4+ DATABASE_TYPE='mysql'
5+ DATABASE_HOST='fba_mysql'
6+ DATABASE_PORT=3306
7+ DATABASE_USER='root'
8+ DATABASE_PASSWORD='123456'
89# Redis
910REDIS_HOST='fba_redis'
1011REDIS_PORT=6379
Original file line number Diff line number Diff line change 1- version : " 3.10"
2-
31networks :
42 fba_network :
53 name : fba_network
@@ -42,7 +40,7 @@ services:
4240 wait-for-it -s fba_mysql:3306 -s fba_redis:6379 -t 300
4341 mkdir -p /var/log/supervisor/
4442 supervisord -c /fba/deploy/backend/supervisor.conf
45- supervisorctl restart fastapi_server
43+ supervisorctl restart
4644
4745 fba_mysql :
4846 image : mysql:8.0.29
@@ -67,15 +65,15 @@ services:
6765# fba_postgres:
6866# image: postgres:16
6967# ports:
70- # - "${DOCKER_MYSQL_MAP_PORT :-5432}:5432"
68+ # - "${DOCKER_POSTGRES_MAP_PORT :-5432}:5432"
7169# container_name: fba_postgres
7270# restart: always
7371# environment:
7472# POSTGRES_DB: fba
7573# POSTGRES_PASSWORD: 123456
7674# TZ: Asia/Shanghai
7775# volumes:
78- # - fba_mysql :/var/lib/postgresql/data
76+ # - fba_postgres :/var/lib/postgresql/data
7977# networks:
8078# - fba_network
8179
@@ -165,6 +163,4 @@ services:
165163 wait-for-it -s fba_rabbitmq:5672 -t 300
166164 mkdir -p /var/log/supervisor/
167165 supervisord -c /fba/deploy/backend/supervisor.conf
168- supervisorctl restart celery_worker
169- supervisorctl restart celery_beat
170- supervisorctl restart celery_flower
166+ supervisorctl restart
You can’t perform that action at this time.
0 commit comments