Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 16 additions & 9 deletions docker/lnt.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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]" \
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've also switched from requirements.server.txt to the dependencies in pyproject.toml in this PR.

&& 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
Expand Down