Spaces:
Building
Building
# Use an official Python runtime as the base image | |
FROM python:3.12.3-slim # Slim version for a smaller image size | |
LABEL authors="muzammil" | |
# Set Hugging Face cache directory to /tmp/.cache (which should be writable) | |
ENV HF_HOME="/tmp/.cache" | |
# Install FFmpeg and other necessary dependencies | |
RUN apt-get update && apt-get install -y ffmpeg && \ | |
apt-get clean && \ | |
rm -rf /var/lib/apt/lists/* | |
# Create a user with a specific UID for permissions handling | |
RUN useradd -m -u 1000 user | |
USER user | |
ENV HOME=/home/user \ | |
PATH=/home/user/.local/bin:$PATH | |
WORKDIR $HOME/app | |
# Copy the current directory contents into the container | |
COPY --chown=user . $HOME/app | |
# Install any required Python dependencies | |
RUN pip install --no-cache-dir -r requirements.txt | |
# Expose the port for Gradio app (usually runs on 7860 by default) | |
EXPOSE 7860 | |
# Command to run the Gradio app | |
CMD ["python3", "app.py"] | |