diff --git a/runtime/requirements-py310 b/extras/requirements-py310 similarity index 100% rename from runtime/requirements-py310 rename to extras/requirements-py310 diff --git a/runtime/requirements-py312 b/extras/requirements-py312 similarity index 100% rename from runtime/requirements-py312 rename to extras/requirements-py312 diff --git a/runtime/requirements-py38 b/extras/requirements-py38 similarity index 100% rename from runtime/requirements-py38 rename to extras/requirements-py38 diff --git a/runtime/Dockerfile b/runtime/Dockerfile index ed5c333..874b312 100644 --- a/runtime/Dockerfile +++ b/runtime/Dockerfile @@ -6,6 +6,7 @@ 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_DEFAULT_INDEX="https://pypi.tuna.tsinghua.edu.cn/simple/" uv sync --frozen --no-dev --no-editable --package runtime RUN mkdir -p /root/.jupyter/custom /app/.venv/share/jupyter/custom && \ @@ -13,14 +14,14 @@ RUN mkdir -p /root/.jupyter/custom /app/.venv/share/jupyter/custom && \ cp /root/.jupyter/custom/custom.css /app/.venv/share/jupyter/custom/custom.css RUN uv venv --python 3.12 /opt/venv/python3.12 && \ - UV_DEFAULT_INDEX="https://pypi.tuna.tsinghua.edu.cn/simple/" uv pip install --python /opt/venv/python3.12/bin/python -r runtime/requirements-py312 + UV_DEFAULT_INDEX="https://pypi.tuna.tsinghua.edu.cn/simple/" uv pip install --python /opt/venv/python3.12/bin/python -r extras/requirements-py312 RUN uv venv --python 3.8 /opt/venv/python3.8 && \ - UV_DEFAULT_INDEX="https://pypi.tuna.tsinghua.edu.cn/simple/" uv pip install --python /opt/venv/python3.8/bin/python -r runtime/requirements-py38 && \ + UV_DEFAULT_INDEX="https://pypi.tuna.tsinghua.edu.cn/simple/" uv pip install --python /opt/venv/python3.8/bin/python -r extras/requirements-py38 && \ /opt/venv/python3.8/bin/python -m ipykernel install --prefix=/opt/venv/python3.12 --name=python38 --display-name="python3.8" RUN uv venv --python 3.10 /opt/venv/python3.10 && \ - UV_DEFAULT_INDEX="https://pypi.tuna.tsinghua.edu.cn/simple/" uv pip install --python /opt/venv/python3.10/bin/python -r runtime/requirements-py310 && \ + UV_DEFAULT_INDEX="https://pypi.tuna.tsinghua.edu.cn/simple/" uv pip install --python /opt/venv/python3.10/bin/python -r extras/requirements-py310 && \ /opt/venv/python3.10/bin/python -m ipykernel install --prefix=/opt/venv/python3.12 --name=python310 --display-name="python3.10" EXPOSE 8000 diff --git a/schedule/Dockerfile b/schedule/Dockerfile index 6886e8a..cfeae40 100644 --- a/schedule/Dockerfile +++ b/schedule/Dockerfile @@ -3,7 +3,19 @@ FROM python-base:3.12 COPY pyproject.toml uv.lock ./ COPY common ./common COPY schedule ./schedule +COPY extras ./extras RUN UV_DEFAULT_INDEX="https://pypi.tuna.tsinghua.edu.cn/simple/" uv sync --frozen --no-dev --no-editable --package schedule +RUN uv venv --python 3.12 /opt/venv/python3.12 && \ + UV_DEFAULT_INDEX="https://pypi.tuna.tsinghua.edu.cn/simple/" uv pip install --python /opt/venv/python3.12/bin/python -r extras/requirements-py312 + +RUN uv venv --python 3.8 /opt/venv/python3.8 && \ + UV_DEFAULT_INDEX="https://pypi.tuna.tsinghua.edu.cn/simple/" uv pip install --python /opt/venv/python3.8/bin/python -r extras/requirements-py38 && \ + /opt/venv/python3.8/bin/python -m ipykernel install --prefix=/opt/venv/python3.12 --name=python38 --display-name="python3.8" + +RUN uv venv --python 3.10 /opt/venv/python3.10 && \ + UV_DEFAULT_INDEX="https://pypi.tuna.tsinghua.edu.cn/simple/" uv pip install --python /opt/venv/python3.10/bin/python -r extras/requirements-py310 && \ + /opt/venv/python3.10/bin/python -m ipykernel install --prefix=/opt/venv/python3.12 --name=python310 --display-name="python3.10" + EXPOSE 8000 CMD ["uv", "run", "--frozen", "--package", "schedule", "gunicorn", "--config", "schedule/gunicorn.conf.py", "schedule.main:app"]