make docker work
This commit is contained in:
+9
-4
@@ -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
@@ -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
|
||||
@@ -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__))
|
||||
|
||||
Reference in New Issue
Block a user