Chore: update environment configuration for local development; modify Dockerfile to streamline SDK installation and enhance startup script for better directory handling; add time verification script for system time synchronization

This commit is contained in:
salirezav
2025-08-08 16:18:37 -04:00
parent 20907509b1
commit 7a939920fa
7 changed files with 113 additions and 39 deletions

View File

@@ -11,18 +11,36 @@ services:
- ./camera-management-api/storage:/storage
environment:
- PYTHONUNBUFFERED=1
- LD_LIBRARY_PATH=/usr/local/lib:/app/camera_sdk/lib
- LD_LIBRARY_PATH=/usr/local/lib:/lib:/usr/lib
- PYTHONPATH=/app:/app/camera_sdk
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;
# Install camera SDK if not already installed
if [ ! -f /lib/libMVSDK.so ] && [ -f 'camera_sdk/linuxSDK_V2.1.0.49(250108)/install.sh' ]; then
echo 'Installing camera SDK...';
cd 'camera_sdk/linuxSDK_V2.1.0.49(250108)';
chmod +x install.sh;
./install.sh;
cd /app;
echo 'Camera SDK installed successfully';
else
echo 'Camera SDK already installed or install script not found';
fi;
# Install Python dependencies
if [ -f requirements.txt ]; then
pip install --no-cache-dir -r requirements.txt;
else
pip install --no-cache-dir -e .;
fi;
# Start the application
python main.py --config config.compose.json
"
ports:
- "8000:8000"
depends_on:
- mqtt
web:
image: node:20-alpine
@@ -36,19 +54,9 @@ services:
command: >
sh -lc "
npm ci;
npm run dev -- --host 0.0.0.0 --port 5173
npm run dev -- --host 0.0.0.0 --port 8080
"
ports:
- "5173:5173"
- "8080:8080"
mqtt:
image: eclipse-mosquitto:2
ports:
- "1883:1883"
volumes:
- mosquitto-data:/mosquitto/data
- mosquitto-conf:/mosquitto/config
volumes:
mosquitto-data:
mosquitto-conf: