X-Git-Url: https://git.madduck.net/etc/vim.git/blobdiff_plain/fcf97961061982656a1384ecc1628e217a52a88c..092959ff1f9253347b01eeb2d6d72e15bad7e25a:/Dockerfile?ds=sidebyside diff --git a/Dockerfile b/Dockerfile index a03d23a..c393e29 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,17 @@ -FROM python:3 +FROM python:3-slim AS builder -ENV PYTHONDONTWRITEBYTECODE 1 -ENV PYTHONUNBUFFERED 1 +RUN mkdir /src +COPY . /src/ +RUN 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 --user --no-cache-dir .[colorama,d] -RUN pip install --upgrade --no-cache-dir black +FROM python:3-slim -ENTRYPOINT /usr/local/bin/black --check --diff . +# copy only Python packages to limit the image size +COPY --from=builder /root/.local /root/.local +ENV PATH=/root/.local/bin:$PATH + +CMD ["black"]