42 lines
1.9 KiB
Docker
42 lines
1.9 KiB
Docker
FROM python-base:3.12
|
|
|
|
ENV UV_HTTP_TIMEOUT=300
|
|
ENV UV_DEFAULT_INDEX=https://pypi.tuna.tsinghua.edu.cn/simple/
|
|
|
|
# 从官方 Rclone 镜像直接复制 rclone 二进制文件(高效、稳定)
|
|
COPY --from=rclone/rclone:latest /usr/local/bin/rclone /usr/local/bin/rclone
|
|
|
|
COPY pyproject.toml uv.lock ./
|
|
COPY common ./common
|
|
COPY runtime ./runtime
|
|
COPY extras ./extras
|
|
RUN uv sync --frozen --no-dev --no-editable --package runtime --no-install-workspace
|
|
|
|
RUN mkdir -p /root/.jupyter/custom /app/.venv/share/jupyter/custom && \
|
|
echo '#top-panel, #top-panel-wrapper, .jp-Notebook-header, .jp-FileEditorHeader {display: none !important; height: 0 !important; min-height: 0 !important; margin: 0 !important; padding: 0 !important; border: none !important; position: absolute !important; pointer-events: none !important; }' > /root/.jupyter/custom/custom.css && \
|
|
cp /root/.jupyter/custom/custom.css /app/.venv/share/jupyter/custom/custom.css
|
|
|
|
RUN uv venv --seed --python 3.8 /opt/venv/python3.8 && \
|
|
uv pip install --python /opt/venv/python3.8/bin/python -r extras/requirements-py38 && \
|
|
/opt/venv/python3.8/bin/python -m ipykernel install \
|
|
--prefix=/usr/local \
|
|
--name=python38 \
|
|
--display-name="Python 3.8"
|
|
|
|
RUN uv venv --seed --python 3.10 /opt/venv/python3.10 && \
|
|
uv pip install --python /opt/venv/python3.10/bin/python -r extras/requirements-py310 && \
|
|
/opt/venv/python3.10/bin/python -m ipykernel install \
|
|
--prefix=/usr/local \
|
|
--name=python310 \
|
|
--display-name="Python 3.10"
|
|
|
|
RUN uv venv --seed --python 3.12 /opt/venv/python3.12 && \
|
|
uv pip install --python /opt/venv/python3.12/bin/python -r extras/requirements-py312 && \
|
|
/opt/venv/python3.12/bin/python -m ipykernel install \
|
|
--prefix=/usr/local \
|
|
--name=python312 \
|
|
--display-name="Python 3.12"
|
|
|
|
EXPOSE 8000
|
|
CMD ["uv", "run", "--frozen", "--package", "runtime", "gunicorn", "--config", "runtime/gunicorn.conf.py", "runtime.main:app"]
|