67 lines
1.8 KiB
YAML
67 lines
1.8 KiB
YAML
services:
|
|
api:
|
|
build:
|
|
context: ./camera-management-api
|
|
dockerfile: Dockerfile
|
|
working_dir: /app
|
|
volumes:
|
|
- ./camera-management-api:/app
|
|
- /storage:/storage
|
|
- /etc/localtime:/etc/localtime:ro
|
|
- /etc/timezone:/etc/timezone:ro
|
|
environment:
|
|
- PYTHONUNBUFFERED=1
|
|
- LD_LIBRARY_PATH=/usr/local/lib:/lib:/usr/lib
|
|
- PYTHONPATH=/app:/app/camera_sdk
|
|
- TZ=America/New_York
|
|
command: >
|
|
sh -lc "
|
|
apt-get update && apt-get install -y libusb-1.0-0-dev;
|
|
|
|
# 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
|
|
"
|
|
network_mode: host
|
|
|
|
web:
|
|
image: node:20-alpine
|
|
working_dir: /app
|
|
env_file:
|
|
- ./management-dashboard-web-app/.env
|
|
volumes:
|
|
- ./management-dashboard-web-app:/app
|
|
environment:
|
|
- CHOKIDAR_USEPOLLING=true
|
|
- TZ=America/New_York
|
|
command: >
|
|
sh -lc "
|
|
npm ci;
|
|
npm run dev -- --host 0.0.0.0 --port 8080
|
|
"
|
|
# Ensure the web container can resolve host.docker.internal on Linux
|
|
extra_hosts:
|
|
- "host.docker.internal:host-gateway"
|
|
ports:
|
|
- "8080:8080"
|
|
|
|
|