deepdetection / Dockerfile
akagtag's picture
fix: add PYTHONPATH environment variable and ensure src is importable in app.py
9cd5561
FROM python:3.11-slim
RUN apt-get update && apt-get install -y --no-install-recommends \
ffmpeg \
libgl1 \
libglib2.0-0 \
libsm6 \
libxext6 \
libxrender1 \
libgles2 \
libegl1 \
libgbm1 \
libgomp1 \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
COPY requirements.txt .
RUN pip install --no-cache-dir --upgrade pip && \
pip install --no-cache-dir -r requirements.txt
COPY . .
ENV MODEL_CACHE_DIR=/data/models
ENV TOKENIZERS_PARALLELISM=false
ENV MESA_GL_VERSION_OVERRIDE=3.3
ENV PYOPENGL_PLATFORM=egl
ENV PYTHONUNBUFFERED=1
ENV PYTHONPATH=/app
EXPOSE 7860
CMD ["python", "spaces/app.py"]