Spaces:
Sleeping
Sleeping
# Use the official Python image | |
FROM python:3.9-slim | |
# Set the working directory | |
WORKDIR /app | |
# Create a writable cache directory for Hugging Face | |
RUN mkdir -p /workspace/huggingface_cache && \ | |
chmod -R 777 /workspace/huggingface_cache | |
# Set environment variable for Hugging Face cache | |
ENV HF_HOME=/workspace/huggingface_cache | |
# Create and set permissions for the /.triton directory to avoid permission issues | |
RUN mkdir -p /root/.triton && chmod -R 777 /root/.triton | |
ENV TRITON_CACHE_DIR=/root/.triton | |
# Install system dependencies | |
RUN apt-get update && apt-get install -y git | |
# Copy the requirements file into the image | |
COPY requirements.txt requirements.txt | |
# Install any needed packages specified in requirements.txt | |
RUN pip install --no-cache-dir -r requirements.txt | |
# Copy the rest of your application code into the image | |
COPY . . | |
# Expose the port your application will run on | |
EXPOSE 7860 | |
# Command to run your application | |
CMD ["python", "app.py"] | |