askrobots / dbbasic-object-server
Public
Runs live, versioned Python application objects on one VM, with a suite of apps: projects, notes, tasks, files and more.
Dockerfile · 1.3 KB · 29 lines
| 1 | # Image for scripts/test_versions.sh: one Python version, plus what the CI |
| 2 | # runner has that the tests use (git, node). Built on demand by that script: |
| 3 | # |
| 4 | # docker build -t ci-py:3.10 --build-arg PY=3.10 --build-arg BASE=3.10 scripts/ci-image |
| 5 | # docker build -t ci-py:3.14t --build-arg PY=3.14t --build-arg BASE=3.14 scripts/ci-image |
| 6 | # |
| 7 | # BASE is the official image's Python; PY is the interpreter the tests run on. |
| 8 | # They differ only for a free-threaded build ("3.14t"), which has no official |
| 9 | # image: it is installed with uv and put first on PATH as `python`. |
| 10 | ARG BASE=3.13 |
| 11 | FROM python:${BASE}-slim-trixie |
| 12 | ARG PY=3.13 |
| 13 | ARG UV_VERSION=0.13.12 |
| 14 | RUN apt-get update \ |
| 15 | && apt-get install -y --no-install-recommends git nodejs ca-certificates \ |
| 16 | && rm -rf /var/lib/apt/lists/* \ |
| 17 | && useradd -m -u 1000 runner |
| 18 | ENV UV_PYTHON_INSTALL_DIR=/opt/uvpy |
| 19 | RUN case "$PY" in \ |
| 20 | *t) pip install --no-cache-dir "uv==${UV_VERSION}" \ |
| 21 | && uv python install "$PY" \ |
| 22 | && mkdir -p /opt/ci-python/bin \ |
| 23 | && ln -s "$(uv python find --managed-python "$PY")" /opt/ci-python/bin/python \ |
| 24 | && /opt/ci-python/bin/python -c "import sys; assert not sys._is_gil_enabled(), 'not a free-threaded build'" ;; \ |
| 25 | *) mkdir -p /opt/ci-python/bin ;; \ |
| 26 | esac |
| 27 | ENV PATH=/opt/ci-python/bin:$PATH |
| 28 | USER runner |
| 29 | ENV HOME=/home/runner |