Skip to content

Commit 63d088d

Browse files
authored
Update the Dockerfile to adapt the CLI (#701)
1 parent a461f78 commit 63d088d

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-10
lines changed

Dockerfile

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ RUN sed -i 's/deb.debian.org/mirrors.ustc.edu.cn/g' /etc/apt/sources.list.d/debi
1010
&& apt-get install -y --no-install-recommends gcc python3-dev \
1111
&& rm -rf /var/lib/apt/lists/*
1212

13+
COPY . /fba
14+
15+
WORKDIR /fba
16+
1317
# Configure uv environment
1418
ENV UV_COMPILE_BYTECODE=1 \
1519
UV_NO_CACHE=1 \
@@ -18,30 +22,27 @@ ENV UV_COMPILE_BYTECODE=1 \
1822

1923
# Install dependencies with cache
2024
RUN --mount=type=cache,target=/root/.cache/uv \
21-
--mount=type=bind,source=uv.lock,target=uv.lock \
22-
--mount=type=bind,source=pyproject.toml,target=pyproject.toml \
2325
uv sync --frozen --no-default-groups --group server
2426

2527
# === Runtime base server image ===
2628
FROM python:3.10-slim AS base_server
2729

28-
SHELL ["/bin/bash", "-c"]
29-
3030
RUN sed -i 's/deb.debian.org/mirrors.ustc.edu.cn/g' /etc/apt/sources.list.d/debian.sources \
3131
&& apt-get update \
3232
&& apt-get install -y --no-install-recommends supervisor \
3333
&& rm -rf /var/lib/apt/lists/*
3434

35-
COPY . /fba
35+
COPY --from=builder /fba /fba
3636

3737
COPY --from=builder /usr/local /usr/local
3838

39+
COPY deploy/backend/supervisord.conf /etc/supervisor/supervisord.conf
40+
3941
# === FastAPI server image ===
4042
FROM base_server AS fastapi_server
4143

4244
WORKDIR /fba
4345

44-
COPY deploy/backend/supervisord.conf /etc/supervisor/supervisord.conf
4546
COPY deploy/backend/fastapi_server.conf /etc/supervisor/conf.d/
4647

4748
RUN mkdir -p /var/log/fastapi_server
@@ -53,9 +54,8 @@ CMD ["uvicorn", "backend.main:app", "--host", "0.0.0.0", "--port","8000"]
5354
# === Celery server image ===
5455
FROM base_server AS celery
5556

56-
WORKDIR /fba/backend/
57+
WORKDIR /fba/backend
5758

58-
COPY deploy/backend/supervisord.conf /etc/supervisor/supervisord.conf
5959
COPY deploy/backend/celery.conf /etc/supervisor/conf.d/
6060

6161
RUN mkdir -p /var/log/celery

backend/__init__.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
#!/usr/bin/env python3
22
# -*- coding: utf-8 -*-
3+
from backend.utils.console import console
34

45
__version__ = '1.5.2'
56

6-
from backend.utils.console import console
7-
87

98
def get_version() -> str | None:
109
console.print(f'[cyan]{__version__}[/]')

0 commit comments

Comments
 (0)