41 lines
1.4 KiB
Docker
41 lines
1.4 KiB
Docker
# syntax=docker/dockerfile:1
|
|
FROM python:3.11-slim
|
|
|
|
ENV PYTHONDONTWRITEBYTECODE=1 \
|
|
PYTHONUNBUFFERED=1
|
|
|
|
WORKDIR /app
|
|
|
|
RUN apt-get update \
|
|
&& apt-get install -y --no-install-recommends ca-certificates curl gnupg \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
# Installer bitcoin-cli (binaire officiel)
|
|
RUN curl -L -o /tmp/bitcoin-cli.tar.gz https://bitcoincore.org/bin/bitcoin-core-26.2/bitcoin-26.2-x86_64-linux-gnu.tar.gz \
|
|
&& mkdir -p /tmp/bitcoin-cli \
|
|
&& tar -xzf /tmp/bitcoin-cli.tar.gz -C /tmp/bitcoin-cli --strip-components=2 bitcoin-26.2/bin/bitcoin-cli \
|
|
&& mv /tmp/bitcoin-cli/bitcoin-cli /usr/local/bin/bitcoin-cli \
|
|
&& chmod +x /usr/local/bin/bitcoin-cli \
|
|
&& rm -rf /tmp/bitcoin-cli /tmp/bitcoin-cli.tar.gz
|
|
|
|
COPY requirements.txt ./
|
|
RUN pip install --no-cache-dir -r requirements.txt
|
|
|
|
# Vendoriser test_framework depuis Bitcoin Core (pour le script signet/miner)
|
|
RUN curl -L -o /tmp/bitcoin-core.tar.gz https://github.com/bitcoin/bitcoin/archive/refs/tags/v26.2.tar.gz \
|
|
&& mkdir -p /tmp/bitcoin-core \
|
|
&& tar -xzf /tmp/bitcoin-core.tar.gz -C /tmp/bitcoin-core --strip-components=1 \
|
|
&& mkdir -p /app/test/functional \
|
|
&& cp -r /tmp/bitcoin-core/test/functional/test_framework /app/test/functional/test_framework \
|
|
&& rm -rf /tmp/bitcoin-core /tmp/bitcoin-core.tar.gz
|
|
|
|
COPY entrypoint.sh ./
|
|
COPY signet_miner.py ./
|
|
COPY signet/ ./signet/
|
|
|
|
RUN chmod +x /app/entrypoint.sh
|
|
|
|
VOLUME ["/bitcoin"]
|
|
|
|
ENTRYPOINT ["/app/entrypoint.sh"]
|