API Dockerfile: install camera SDK from local tarball under camera_sdk; compose: build API image and set LD_LIBRARY_PATH fallback
This commit is contained in:
@@ -2,15 +2,20 @@ version: "3.9"
|
||||
|
||||
services:
|
||||
api:
|
||||
image: python:3.11-slim
|
||||
build:
|
||||
context: ./api
|
||||
dockerfile: Dockerfile
|
||||
working_dir: /app
|
||||
volumes:
|
||||
- ./api:/app
|
||||
- ./api/storage:/storage
|
||||
environment:
|
||||
- PYTHONUNBUFFERED=1
|
||||
- LD_LIBRARY_PATH=/usr/local/lib:/app/camera_sdk/lib
|
||||
command: >
|
||||
sh -lc "
|
||||
apt-get update && apt-get install -y libusb-1.0-0-dev;
|
||||
if [ -d camera_sdk/lib ]; then cp camera_sdk/lib/* /usr/local/lib/ 2>/dev/null || true; fi;
|
||||
if [ -f requirements.txt ]; then pip install --no-cache-dir -r requirements.txt; else pip install --no-cache-dir -e .; fi;
|
||||
python main.py --config config.compose.json
|
||||
"
|
||||
@@ -47,4 +52,3 @@ services:
|
||||
volumes:
|
||||
mosquitto-data:
|
||||
mosquitto-conf:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user