emotion-recognition / Dockerfile
joyjonesmark's picture
Initial deploy with models
e5abc2e
# Base image with TensorFlow GPU support
# Use CPU version for Hugging Face Spaces free tier compatibility if needed
# But keeping GPU as the project is configured for it.
# HF Spaces offers CPU Basic (Free) and GPU upgrades.
# Using a lighter base image might be better for free tier, but TF is heavy anyway.
FROM tensorflow/tensorflow:2.13.0
# Set working directory
WORKDIR /app
# Install system dependencies including libGL for OpenCV
RUN apt-get update && apt-get install -y \
libgl1-mesa-glx \
libglib2.0-0 \
libsm6 \
libxext6 \
libxrender-dev \
&& rm -rf /var/lib/apt/lists/*
# Copy requirements first for caching
COPY requirements.txt .
# Install Python dependencies
RUN pip install --no-cache-dir -r requirements.txt
# Copy application code
COPY src/ ./src/
COPY frontend/ ./frontend/
# Create a models directory
# Note: You must upload your trained models here or use Git LFS
COPY models/ ./models/
# Expose the port Hugging Face Spaces expects
EXPOSE 7860
# Default command to run Streamlit on port 7860
CMD ["streamlit", "run", "frontend/app.py", "--server.port", "7860", "--server.address", "0.0.0.0"]