Files
routstr-core/Dockerfile
9qeklajc c2c6ac7491 fix(docker): put /app on PYTHONPATH for in-container scripts
The image syncs dependencies with --no-install-project, so routstr is only
importable from the working directory. Running scripts/<name>.py puts
/app/scripts on sys.path instead, so every documented
'docker compose exec routstr /.venv/bin/python scripts/*.py' command
(reveal_nsec, reset_admin_password, create_cli_token) and the automatic
CLI-token step in node_setup.py failed with ModuleNotFoundError.
2026-10-07 13:11:17 +00:00

38 lines
863 B
Docker

ARG PYTHON_VERSION=3.14
FROM ghcr.io/astral-sh/uv:python${PYTHON_VERSION}-bookworm-slim
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
git \
build-essential \
pkg-config \
libffi-dev \
libsecp256k1-dev \
autoconf \
automake \
libtool \
&& rm -rf /var/lib/apt/lists/*
COPY uv.lock pyproject.toml ./
RUN mkdir -p /routstr
RUN uv sync --frozen --no-dev --no-install-project
WORKDIR /app
COPY . .
ARG GIT_COMMIT=""
ARG GIT_TAG=""
ENV GIT_COMMIT=${GIT_COMMIT}
ENV GIT_TAG=${GIT_TAG}
ENV PORT=8000
ENV PYTHONUNBUFFERED=1
# routstr is not installed into the venv (--no-install-project); make it importable
# for `python scripts/<name>.py` run via `docker compose exec`.
ENV PYTHONPATH=/app
EXPOSE 8000
CMD ["/.venv/bin/fastapi", "run", "routstr", "--host", "0.0.0.0"]