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

@@ -3,23 +3,17 @@ FROM python:3.11-slim
# Install system dependencies required by SDK and tooling
RUN apt-get update && apt-get install -y --no-install-recommends \
bash ca-certificates tar \
bash ca-certificates tar sudo \
libusb-1.0-0 libgl1 libx11-6 libxext6 libxcb1 libgtk-3-0 \
libusb-1.0-0-dev udev \
&& rm -rf /var/lib/apt/lists/*
# Copy SDK bundle placed under api/camera_sdk and install native libs
# Set working directory
WORKDIR /app
COPY camera_sdk /tmp/camera_sdk
RUN set -eux; \
mkdir -p /opt/mvsdk; \
TARBALL="$(find /tmp/camera_sdk -maxdepth 1 -type f -name '*.tar.gz' | head -n1)"; \
if [ -z "$TARBALL" ]; then echo 'No SDK .tar.gz found in camera_sdk'; exit 1; fi; \
tar -xzf "$TARBALL" -C /opt/mvsdk || true; \
# Copy any .so library files into /usr/lib so ctypes can load libMVSDK.so
find /opt/mvsdk -type f -name '*.so*' -exec cp -n {} /usr/lib/ \; || true; \
ldconfig || true
# Set environment variables for library paths and Python path
ENV LD_LIBRARY_PATH=/usr/lib:/usr/local/lib:/lib
ENV PYTHONPATH=/app:/app/camera_sdk
ENV LD_LIBRARY_PATH=/usr/lib:/usr/local/lib
# The actual app code is bind-mounted by docker-compose at runtime
# The actual app code and SDK will be bind-mounted by docker-compose at runtime
# SDK installation will be handled in the docker-compose command