make docker work

This commit is contained in:
2025-02-28 14:50:04 +01:00
parent 174c4bd6b3
commit f682c3af94
3 changed files with 28 additions and 15 deletions
+9 -4
View File
@@ -1,4 +1,5 @@
FROM python:3.11
# TODO: investigate using -alpine in the future
FROM python:3.11
WORKDIR /usr/src/app
@@ -12,10 +13,14 @@ RUN --mount=type=cache,target=/root/.cache \
--mount=type=ssh,required=true \
pip install ./
#CMD [ "python", "./your-daemon-or-script.py" ]
# make sure to install sudo apt install docker-buildx
# make sure to set IdentityFile /home/pstruebi/.ssh/id_ed25519 in ~/.ssh/config -maybe not nececcary
# example build commands:
# docker build --ssh default .
# docker build --ssh default=~/.ssh/id_rsa .
# docker build --ssh default=~/.ssh/id_rsa .
# docker build --ssh default -t bumble-auracast:latest .
# example run commands
# interactive:
# docker run --rm -it --device /dev/serial/by-id/usb-ZEPHYR_Zephyr_HCI_UART_sample_81BD14B8D71B5662-if00 bumble-auracast bash
+13 -10
View File
@@ -3,14 +3,17 @@ services:
build:
context: .
dockerfile: Dockerfile
#ssh: ["default"] # Enable SSH agent forwarding
ssh: ['default','default=~/.ssh/'] #raspi
volumes:
- /dev:/dev # Mount /dev from host to container
ssh:
- default=~/.ssh/id_ed25519 #lappi
#- default=~/.ssh/id_rsa #raspi
devices:
- /dev/serial/by-id/usb-ZEPHYR_Zephyr_HCI_UART_sample_81BD14B8D71B5662-if00
environment:
- DOCKER_BUILDKIT=1 # Enable BuildKit (can also be passed during build)
# deploy:
# resources:
# reservations:
# devices:
# - capabilities: [all] # Ensures the container can use /dev as needed
LOG_LEVEL: INFO
# - DOCKER_BUILDKIT=1 # Enable BuildKit (can also be passed during build)
#command: python ./auracast/multicast_server.py #devserver
command: python ./auracast/multicast.py # continously streaming test app
# use docker compose up --build
+6 -1
View File
@@ -491,8 +491,13 @@ async def broadcast(global_conf: auracast_config.AuracastGlobalConfig, big_conf:
if __name__ == "__main__":
import os
if os.environ['LOG_LEVEL']:
log_level = getattr(logging, os.environ['LOG_LEVEL'])
else:
log_level = logging.DEBUG
log_level = os.environ['LOG_LEVEL']
logging.basicConfig(
level=logging.DEBUG,
level=log_level,
format='%(module)s.py:%(lineno)d %(levelname)s: %(message)s'
)
os.chdir(os.path.dirname(__file__))