mirror of
https://github.com/stardrophere/InsightRadar.git
synced 2026-06-05 23:07:51 +08:00
docker配置修改
This commit is contained in:
@@ -1,13 +0,0 @@
|
||||
.venv
|
||||
.git
|
||||
__pycache__
|
||||
*.pyc
|
||||
*.pyo
|
||||
*.pyd
|
||||
.pytest_cache
|
||||
.mypy_cache
|
||||
.cache
|
||||
.env
|
||||
*.log
|
||||
dist
|
||||
build
|
||||
@@ -1,31 +0,0 @@
|
||||
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"]
|
||||
Reference in New Issue
Block a user