diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..d2aff30 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,28 @@ +services: + pymc-repeater: + image: ${PYMC_REPEATER_IMAGE:-pymcdev/pymc-repeater:main} + container_name: pymc-repeater + restart: unless-stopped + ports: + - 8000:8000 + devices: + # SPI DEVICES (Your path may differ) + - /dev/spidev0.0 + - /dev/gpiochip0 + # USB DEVICES (Your path may differ) + - /dev/bus/usb/002:/dev/bus/usb/002 + # SPI DEVICES PERMISSIONS + cap_add: + - SYS_RAWIO + # USB DEVICE PERMISSIONS + group_add: + - "${GPIO_GID:-986}" + - "${SPI_GID:-989}" + - plugdev + volumes: + - ${PYMC_CONFIG_VOLUME:-pymc-repeater-config}:/etc/pymc_repeater + - ${PYMC_DATA_VOLUME:-pymc-repeater-data}:/var/lib/pymc_repeater + +volumes: + pymc-repeater-config: + pymc-repeater-data: diff --git a/env.example b/env.example new file mode 100644 index 0000000..af3af2c --- /dev/null +++ b/env.example @@ -0,0 +1,31 @@ +# Copy this file to .env before running Docker Compose: +# cp .env.example .env + +# Published image to run. Use a different repository or tag if you are testing +# a fork or a specific release. +PYMC_REPEATER_IMAGE=pymcdev/pymc-repeater:main + +# Storage defaults to Docker named volumes. This is the safest option for +# Portainer and fresh installs because Docker preserves the image ownership. +# To use host bind mounts instead, create the folders first and make them +# writable by UID/GID 15888: +# sudo mkdir -p /opt/pymc-repeater/config /opt/pymc-repeater/data +# sudo chown -R 15888:15888 /opt/pymc-repeater/config /opt/pymc-repeater/data +# Then uncomment and adjust these paths: +# PYMC_CONFIG_VOLUME=/opt/pymc-repeater/config +# PYMC_DATA_VOLUME=/opt/pymc-repeater/data + +# SPI/GPIO access uses the host's numeric group IDs. Check your host with: +# getent group gpio +# getent group spi +# Example output: +# gpio:x:997: +# spi:x:999: +# Put the third field from each output line below. +GPIO_GID=986 +SPI_GID=989 + +# Local build only. These are used by docker-compose.build.yml if you build the +# image yourself instead of pulling PYMC_REPEATER_IMAGE. +PUID=15888 +PGID=15888