A Python port of the Invisible Internet Project (I2P)
1# I2P Python Router — Integration Test Container
2#
3# Builds a minimal container with our Python I2P implementation
4# for live network bootstrap testing.
5
6FROM python:3.11-slim-bookworm
7
8# Install system dependencies (cryptography needs OpenSSL headers)
9RUN apt-get update && \
10 apt-get install -y --no-install-recommends \
11 gcc \
12 libffi-dev \
13 libssl-dev \
14 && rm -rf /var/lib/apt/lists/*
15
16# Create app directory
17WORKDIR /app
18
19# Copy source
20COPY pyproject.toml /app/
21COPY src/ /app/src/
22COPY tests/integration/ /app/tests/integration/
23
24# Install the package + test dependencies
25RUN pip install --no-cache-dir -e ".[dev]"
26
27# Create data directory for persistent identity + netdb
28RUN mkdir -p /data/i2p
29
30# Environment
31ENV PYTHONUNBUFFERED=1
32ENV I2P_DATA_DIR=/data/i2p
33ENV I2P_LISTEN_HOST=0.0.0.0
34ENV I2P_LISTEN_PORT=9000
35
36# Expose NTCP2 port
37EXPOSE 9000/tcp
38
39# Default: run the integration test
40CMD ["python", "-m", "tests.integration.network_test"]