Skip to content
Open
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.venv/
69 changes: 48 additions & 21 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,52 @@ RUN git checkout $LIGHTNINGD_VERSION
RUN ./configure --prefix=/tmp/lightning_install --enable-developer --disable-valgrind --enable-experimental-features
RUN make -j $(nproc) install

FROM ubuntu:latest as final
FROM ubuntu:latest as python-builder

COPY --from=builder /tmp/lightning_install/ /usr/local/
COPY --from=builder /tmp/lightning/ /usr/local/src/lightning/

RUN apt-get update -qq \
&& apt-get install -y --no-install-recommends \
libsqlite3-dev \
zlib1g-dev \
libsodium-dev \
libgmp-dev \
python3 \
python3-pip \
wget \
&& apt-get install -y --no-install-recommends \
build-essential \
pkg-config \
python3 \
python3-dev \
python3-pip \
python3-venv \
git \
tree \
&& rm -rf /var/lib/apt/lists/*
&& rm -rf /var/lib/apt/lists/*

WORKDIR /opt
COPY ./*.py /opt/
COPY ./nostr /opt/nostr
COPY ./tests /opt/tests

# RUN git submodule update --init --recursive
ADD ci-requirements.txt /tmp/

RUN python3 -m venv .venv
ENV PATH="/opt/.venv/bin:$PATH"
RUN pip3 install wheel
RUN pip3 install /usr/local/src/lightning/contrib/pyln-client
RUN pip3 install /usr/local/src/lightning/contrib/pyln-testing
RUN pip3 install -r /tmp/ci-requirements.txt

RUN pip3 install git+https://github.com/joelklabo/python-nostr.git

FROM ubuntu:latest as final

RUN apt-get update -qq \
&& apt-get install -y --no-install-recommends \
libsqlite3-dev \
zlib1g-dev \
libsodium-dev \
libgmp-dev \
python3 \
python3-venv \
wget \
tree \
&& rm -rf /var/lib/apt/lists/*

ARG BITCOIN_VERSION=24.0.1
ENV BITCOIN_TARBALL bitcoin-${BITCOIN_VERSION}-x86_64-linux-gnu.tar.gz
Expand All @@ -51,16 +80,14 @@ ENV TEST_DEBUG 1
# Speed up testing by shortening all timeouts
ENV DEVELOPER 1

WORKDIR /build
COPY . /build/

RUN git submodule update --init --recursive
ADD ci-requirements.txt /tmp/

RUN pip3 install /usr/local/src/lightning/contrib/pyln-client
RUN pip3 install /usr/local/src/lightning/contrib/pyln-testing
RUN pip3 install -r /tmp/ci-requirements.txt
COPY --from=builder /tmp/lightning_install/ /usr/local/
COPY --from=python-builder /opt/.venv /opt/.venv
COPY --from=python-builder /opt/tests /opt/tests
# COPY --from=python-builder /opt/nostr /opt/nostr
COPY --from=python-builder /opt/*.py /opt/

RUN pip3 install git+https://github.com/joelklabo/python-nostr.git
ENV VIRTUAL_ENV=/opt/.venv
RUN python3 -m venv $VIRTUAL_ENV
ENV PATH="$VIRTUAL_ENV/bin:$PATH"

CMD ["pytest", "-vvv", "-n=auto", "-k", "tests"]