# Use an official Python runtime as the base image | |
FROM python:3.10 | |
# Install torch first to make it available for other packages' build processes | |
RUN pip install torch | |
# Copy requirements.txt and install remaining dependencies | |
COPY requirements.txt /tmp/requirements.txt | |
RUN pip install --no-cache-dir -r /tmp/requirements.txt | |
# Copy your application code to the container | |
COPY . /app | |
WORKDIR /app | |
# Expose the port (default for Gradio/Hugging Face Spaces is 7860) | |
EXPOSE 7860 | |
# Command to run your application (adjust 'app.py' to your main script) | |
CMD ["python", "app.py"] |