feat: Run in Docker

This commit is contained in:
Anton Tanchin 2026-05-06 22:44:38 +03:00
parent a1f8de5a39
commit 9a105d59b8
4 changed files with 75 additions and 0 deletions

11
.dockerignore Normal file
View file

@ -0,0 +1,11 @@
.git
.github
.pytest_cache
__pycache__
*.py[cod]
*.egg-info
.venv
venv
dist
build
docs/sample-output.json

19
Dockerfile Normal file
View file

@ -0,0 +1,19 @@
FROM python:3.12-slim
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1
WORKDIR /app
RUN apt-get update \
&& apt-get install -y --no-install-recommends ca-certificates \
&& rm -rf /var/lib/apt/lists/*
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY . .
RUN pip install --no-cache-dir .
ENTRYPOINT ["rkn-check"]
CMD ["--help"]

View file

@ -86,6 +86,40 @@ pip install -e .
rkn-check
```
## Run with Docker
Build the image:
```bash
docker build -t rkn-block-checker .
```
Show CLI help:
```bash
docker run --rm rkn-block-checker
```
Run a real check:
```bash
docker run --rm rkn-block-checker --json
```
Use custom target lists from the current directory:
```bash
docker run --rm -v "$PWD:/work" -w /work rkn-block-checker \
--white-file ./whitelist.txt \
--black-file ./blacklist.txt
```
With Docker Compose:
```bash
docker compose run --rm rkn-check --json
```
## Usage
```text

11
docker-compose.yml Normal file
View file

@ -0,0 +1,11 @@
services:
rkn-check:
build:
context: .
image: rkn-block-checker:latest
stdin_open: true
tty: true
working_dir: /work
volumes:
- ./:/work
command: ["--help"]