Spaces:
Build error
Build error
Regino commited on
Commit Β·
95a3efa
1
Parent(s): 3474ac6
fixed docker
Browse files1 unmodified line234567891011121314151617181920211 unmodified lineWORKDIR /appRUN apt-get update && apt-get install -y \build-essential \curl \software-properties-common \git \&& rm -rf /var/lib/apt/lists/*COPY requirements.txt ./COPY src/ ./src/RUN pip3 install -r requirements.txtEXPOSE 8501HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/healthENTRYPOINT ["streamlit", "run", "src/streamlit_app.py", "--server.port=8501", "--server.address=0.0.0.0"]1 unmodified line23456789101112131415161718192021222324252627282930313233343536373839404142434445464748491 unmodified lineWORKDIR /app# Install system dependencies required by OpenCV and other build tools# libgl1-mesa-glx: Provides libGL.so.1 (OpenGL library) - THIS IS THE KEY FIX# libsm6, libxrender1: Common X11 dependencies often needed by OpenCV# ffmpeg: Good for general video processing capabilities# build-essential, curl, software-properties-common, git: Keep your existing dev toolsRUN apt-get update && apt-get install -y \build-essential \curl \software-properties-common \git \libgl1-mesa-glx \libsm6 \libxrender1 \ffmpeg \# Clean up apt caches to reduce image size&& rm -rf /var/lib/apt/lists/*# Copy your requirements.txt fileCOPY requirements.txt ./# Install Python dependencies from requirements.txtRUN pip3 install --no-cache-dir -r requirements.txt# Copy your application source code and assets# This assumes your project structure looks something like this:# project_root/# βββ src/# β βββ streamlit_app.py (your app.py renamed/moved to here)# βββ models/# β βββ emotion_model_best.h5# βββ cascades/# β βββ haarcascade_frontalface_default.xml# βββ requirements.txt# βββ Dockerfile## COPY . . copies everything from your project_root into /app in the container.COPY . .EXPOSE 8501HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health# Ensure the entrypoint path is correct for your app within the container# Based on your structure, it's inside 'src/'ENTRYPOINT ["streamlit", "run", "src/streamlit_app.py", "--server.port=8501", "--server.address=0.0.0.0"]
Dockerfile+30-2