diff --git a/Dockerfile b/Dockerfile index b518099..666ea45 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,9 +1,9 @@ # TODO: investigate using -alpine in the future -FROM python:3.11 +FROM python:3.11-bookworm # Install system dependencies and poetry RUN apt-get update && apt-get install -y \ - iputils-ping \ + iputils-ping portaudio19-dev\ && apt-get clean \ && rm -rf /var/lib/apt/lists/* diff --git a/docker-compose-test.yaml b/docker-compose-test.yaml index 14fb30b..181a9ba 100644 --- a/docker-compose-test.yaml +++ b/docker-compose-test.yaml @@ -1,6 +1,6 @@ services: multicaster: - container_name: multicaster-test + container_name: multicaster privileged: true # Grants full access to all devices (for serial access) restart: unless-stopped ports: diff --git a/docker-compose-webui.yaml b/docker-compose-webui.yaml index 0e6dbfa..8c44d6b 100644 --- a/docker-compose-webui.yaml +++ b/docker-compose-webui.yaml @@ -1,8 +1,8 @@ +services: multicaster: container_name: multicast-webapp privileged: true # Grants full access to all devices (for serial access) restart: unless-stopped - network_mode: service:wireguard ports: - "8501:8501" build: @@ -11,7 +11,8 @@ - default=~/.ssh/id_ed25519 #lappi #- default=~/.ssh/id_rsa #raspi volumes: - - "/dev/serial:/dev/serial" + - "/dev/serial:/dev/serial" + - "/dev/snd:/dev/snd" #devices: # - /dev/serial/by-id/usb-ZEPHYR_Zephyr_HCI_UART_sample_81BD14B8D71B5662-if00 environment: @@ -19,5 +20,5 @@ # start the server and the frontend command: > - python ./auracast/multicast_server.py & streamlit run ./auracast/server/multicast_frontend.py + bash -c "python ./auracast/server/multicast_server.py & streamlit run ./auracast/server/multicast_frontend.py" diff --git a/src/auracast/server/multicast_frontend.py b/src/auracast/server/multicast_frontend.py index 0f53cf7..e98b892 100644 --- a/src/auracast/server/multicast_frontend.py +++ b/src/auracast/server/multicast_frontend.py @@ -1,5 +1,5 @@ # frontend/app.py -from itertools import filterfalse +import os import streamlit as st import requests from auracast import auracast_config @@ -240,6 +240,6 @@ else: # st.error("Could not fetch advertised streams.") log.basicConfig( - level=log.DEBUG, + level=os.environ.get('LOG_LEVEL', log.DEBUG), format='%(module)s.py:%(lineno)d %(levelname)s: %(message)s' ) \ No newline at end of file diff --git a/src/auracast/server/multicast_server.py b/src/auracast/server/multicast_server.py index 06b69cb..6961678 100644 --- a/src/auracast/server/multicast_server.py +++ b/src/auracast/server/multicast_server.py @@ -362,7 +362,7 @@ async def shutdown(): if __name__ == '__main__': import uvicorn log.basicConfig( - level=log.DEBUG, + level=os.environ.get('LOG_LEVEL', log.DEBUG), format='%(module)s.py:%(lineno)d %(levelname)s: %(message)s' ) uvicorn.run(app, host="0.0.0.0", port=5000) \ No newline at end of file