Merge pull request #116 from migillett/feature/docker-support

Feature/docker support
This commit is contained in:
Lloyd
2026-03-03 14:01:21 +00:00
committed by GitHub
3 changed files with 61 additions and 2 deletions

View File

@@ -316,6 +316,17 @@ This script will:
The script will prompt you for each optional removal step.
## Docker
You can now run PyMC Repeater from within a [Docker Container](https://www.docker.com/). Checkout the example [Docker Compose](./docker-compose.yml) file before you get started.
```bash
docker compose up -d --force-recreate --build
```
Just note that you will have to pass in a `config.yaml` into the container. You can create a new config by following the instructions in the [Configuration section](#configuration).
## Roadmap / Planned Features
- [ ] **Public Map Integration** - Submit repeater location and details to public map for discovery
@@ -363,8 +374,6 @@ Pre-commit hooks will automatically:
- Lint with flake8
- Fix trailing whitespace and other file issues
## Support
- [Core Lib Documentation](https://rightup.github.io/pyMC_core/)

15
docker-compose.yml Normal file
View File

@@ -0,0 +1,15 @@
services:
pymc-repeater:
build: .
container_name: pymc-repeater
restart: unless-stopped
ports:
- 8000:8000
devices:
- /dev/spidev0.0
- /dev/gpiochip0
cap_add:
- SYS_RAWIO
volumes:
- ./config.yaml:/etc/pymc_repeater/config.yaml
- ./data:/var/lib/pymc_repeater

35
dockerfile Normal file
View File

@@ -0,0 +1,35 @@
FROM python:3.12-slim-bookworm
ENV INSTALL_DIR=/opt/pymc_repeater \
CONFIG_DIR=/etc/pymc_repeater \
DATA_DIR=/var/lib/pymc_repeater \
PYTHONUNBUFFERED=1 \
SETUPTOOLS_SCM_PRETEND_VERSION_FOR_PYMC_REPEATER=1.0.5
# Install runtime dependencies only
RUN apt-get update && apt-get install -y \
libffi-dev \
python3-rrdtool \
jq \
wget \
swig \
git \
build-essential \
python3-dev \
&& rm -rf /var/lib/apt/lists/*
# Create runtime directories
RUN mkdir -p ${INSTALL_DIR} ${CONFIG_DIR} ${DATA_DIR}
WORKDIR ${INSTALL_DIR}
# Copy source
COPY repeater ./repeater
COPY pyproject.toml .
# Install package
RUN pip install --no-cache-dir .
EXPOSE 8000
ENTRYPOINT ["python3", "-m", "repeater.main", "--config", "/etc/pymc_repeater/config.yaml"]