X-Git-Url: https://git.madduck.net/etc/vim.git/blobdiff_plain/fcf97961061982656a1384ecc1628e217a52a88c..5d5bf6e0878539baeef797b87636235b8c02be3f:/Dockerfile diff --git a/Dockerfile b/Dockerfile index a03d23a..a9e0ea5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,19 @@ -FROM python:3 +FROM python:3.11-slim AS builder -ENV PYTHONDONTWRITEBYTECODE 1 -ENV PYTHONUNBUFFERED 1 +RUN mkdir /src +COPY . /src/ +ENV VIRTUAL_ENV=/opt/venv +RUN python -m venv $VIRTUAL_ENV +RUN . /opt/venv/bin/activate && pip install --no-cache-dir --upgrade pip setuptools wheel \ + # Install build tools to compile dependencies that don't have prebuilt wheels + && apt update && apt install -y git build-essential \ + && cd /src \ + && pip install --no-cache-dir .[colorama,d] -RUN pip install --upgrade --no-cache-dir black +FROM python:3.11-slim -ENTRYPOINT /usr/local/bin/black --check --diff . +# copy only Python packages to limit the image size +COPY --from=builder /opt/venv /opt/venv +ENV PATH="/opt/venv/bin:$PATH" + +CMD ["/opt/venv/bin/black"]