mirror of
https://github.com/stardrophere/InsightRadar.git
synced 2026-06-06 03:07:50 +08:00
31 lines
578 B
Docker
31 lines
578 B
Docker
FROM python:3.11-slim AS builder
|
|
|
|
WORKDIR /insightradar
|
|
|
|
COPY pyproject.toml uv.lock ./
|
|
|
|
RUN --mount=type=cache,target=/root/.cache/uv \
|
|
pip install --no-cache-dir uv && \
|
|
uv sync --frozen --no-dev
|
|
|
|
COPY app app
|
|
COPY main.py main.py
|
|
|
|
#-----------------------------------------------
|
|
|
|
FROM python:3.11-slim
|
|
|
|
WORKDIR /insightradar
|
|
|
|
# 👇 复制虚拟环境
|
|
COPY --from=builder /insightradar/.venv /insightradar/.venv
|
|
|
|
COPY app app
|
|
COPY main.py main.py
|
|
|
|
# 👇 关键:用 venv 里的 python
|
|
ENV PATH="/insightradar/.venv/bin:$PATH"
|
|
|
|
EXPOSE 8000
|
|
|
|
CMD ["python","main.py"] |