| |
| FROM python:3.11-slim AS base |
|
|
| LABEL maintainer="SmartClass Team" |
| LABEL description="SmartClass Edge Node - Face Recognition Pipeline" |
|
|
| |
| RUN apt-get update && apt-get install -y --no-install-recommends \ |
| libglib2.0-0 \ |
| libsm6 \ |
| libxext6 \ |
| libxrender-dev \ |
| libgomp1 \ |
| libgl1-mesa-glx \ |
| libv4l-dev \ |
| wget \ |
| curl \ |
| && rm -rf /var/lib/apt/lists/* |
|
|
| |
| RUN useradd -m -s /bin/bash smartclass |
| WORKDIR /opt/smartclass |
|
|
| |
| COPY requirements.txt . |
| RUN pip install --no-cache-dir -r requirements.txt |
|
|
| |
| COPY src/ ./src/ |
| COPY config/ ./config/ |
|
|
| |
| RUN mkdir -p /opt/smartclass/data/deploy \ |
| /opt/smartclass/data/offline_queue \ |
| /opt/smartclass/models \ |
| && chown -R smartclass:smartclass /opt/smartclass |
|
|
| |
| ENV PYTHONPATH=/opt/smartclass/src |
| ENV PYTHONUNBUFFERED=1 |
|
|
| |
| USER smartclass |
|
|
| |
| EXPOSE 9100 |
|
|
| |
| HEALTHCHECK --interval=15s --timeout=5s --retries=3 --start-period=45s \ |
| CMD python -c "import urllib.request; urllib.request.urlopen('http://127.0.0.1:9100/metrics')" |
|
|
| |
| CMD ["python", "-m", "edge_pipeline"] |
|
|