Exposes two http entrypoints at host:8080. Assumes r8 is connected via usb serial. Device and Audio can be set in environment variables: R8_AUDIO_DEV: plughw:Generic_1,0 R8_DEVICE: /dev/ttyUSB0 Host is assumed running Linux
r8ctl http://ip-addr:8080/r8ctl?cmd=r8-command http://ip-addr:8080/r8ctl?cmd=PO #turns on power
r8_audio - wav stream of real time audio http://ip-addr:8080/r8_audio/
This container accepts and hosts a controlling web page that provides a gui interface to r8ctl but that is not included in this image. Environment variable R8_CONFIG can be set with a cherrypy config file to expose additional html endpoints. Default config is assumed to be located in container at /r8/r8.conf set a volume to provide your own conf file.
A minimal .conf is needed.
[global]
server.thread_pool = 4
server.socket_host = '::'
server.socket_port = 8080
engine.autoreload.on = False
request.show_tracebacks = False
log.access_file = ''
log.error_file = ''
log.screen = True
[/]
tools.staticdir.root = "/r8/html/"
tools.staticdir.on = True
tools.staticdir.dir = ""
tools.staticdir.index = "r8.html"
tools.proxy.on = True
Here is an example compose file:
name: r8
services:
r8:
image: dgadams/r8
container_name: r8
restart: unless-stopped
ports:
- 8080:8080
# host devices must have permissions set
# default user is www and needs dialout r/w
# and /dev/snd must be readable by www
devices:
- /dev/ttyUSB0:/dev/ttyUSB0
- /dev/snd:/dev/snd
environment:
R8_AUDIO_DEV: plughw:Generic_1,0
R8_DEVICE: /dev/ttyUSB0
R8_CONFIG: /r8/r8.conf
group_add:
- dialout # Ensures access to TTY devices
- 29 # Ensures audio access
# These two volumes are necessary. r8.conf must match env above.
volumes:
- /var/r8/html:/r8/html:ro
- /var/r8/r8.conf:/r8/r8.conf:ro
cap_drop:
- ALL
security_opt:
- no-new-privileges:true
read_only: true # optional, needs a writable /tmp or home volume
Content type
Image
Digest
sha256:7372a560b…
Size
8.1 MB
Last updated
3 days ago
docker pull dgadams/r8