diff --git a/docker/lnt.dockerfile b/docker/lnt.dockerfile index d2d17cbf..5d945acb 100644 --- a/docker/lnt.dockerfile +++ b/docker/lnt.dockerfile @@ -28,17 +28,24 @@ FROM python:3.10-alpine -# Install dependencies +COPY pyproject.toml . +COPY lnt/testing/profile lnt/testing/profile + +# Fake a version for setuptools so we don't need to COPY .git +ENV SETUPTOOLS_SCM_PRETEND_VERSION=0.1 + +# Install dependencies and build cperf ext-modules. RUN apk update \ - && apk add --no-cache --virtual .build-deps git g++ postgresql-dev yaml-dev \ - && apk add --no-cache libpq + && apk add --no-cache --virtual .build-deps g++ postgresql-dev yaml-dev \ + && apk add --no-cache git libpq \ + && pip install ".[server]" \ + && apk --purge del .build-deps -# Install LNT itself, without leaving behind any sources inside the image. -RUN --mount=type=bind,source=.,target=./lnt-source \ - cp -R lnt-source /tmp/lnt-src && \ - cd /tmp/lnt-src && \ - pip3 install -r requirements.server.txt && apk --purge del .build-deps && \ - rm -rf /tmp/lnt-src +# Let setuptools_scm use git to pick the version +ENV SETUPTOOLS_SCM_PRETEND_VERSION= +# Copy over sources and install LNT. +COPY . . +RUN pip install . # Prepare volumes that will be used by the server VOLUME /var/lib/lnt /var/log/lnt