Spaces:
Sleeping
Sleeping
| # Use Python 3.11 slim image as base | |
| FROM python:3.11-slim | |
| # Set working directory | |
| WORKDIR /app | |
| # Install system dependencies and download official unrar | |
| RUN apt-get update && apt-get install -y \ | |
| wget \ | |
| && wget https://www.rarlab.com/rar/rarlinux-x64-700.tar.gz \ | |
| && tar -xzf rarlinux-x64-700.tar.gz \ | |
| && cp rar/unrar /usr/local/bin/ \ | |
| && cp rar/unrar /usr/bin/ \ | |
| && chmod +x /usr/local/bin/unrar \ | |
| && chmod +x /usr/bin/unrar \ | |
| && rm -rf rar rarlinux-x64-700.tar.gz \ | |
| && apt-get clean \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # Copy requirements first for better caching | |
| COPY requirements.txt . | |
| # Install Python dependencies | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # Copy the application code | |
| COPY app.py . | |
| # Create a directory for temporary files | |
| RUN mkdir -p /tmp/gradio_temp | |
| # Set environment variables | |
| ENV GRADIO_SERVER_NAME="0.0.0.0" | |
| ENV GRADIO_SERVER_PORT="7860" | |
| # Expose the port Gradio runs on | |
| EXPOSE 7860 | |
| # Run the application | |
| CMD ["python", "app.py"] |