Spaces:
Runtime error
Runtime error
| FROM python:3.9-slim | |
| WORKDIR /app | |
| # Install system dependencies | |
| RUN apt-get update && apt-get install -y \ | |
| gcc \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # Copy requirements and install Python dependencies | |
| COPY requirements.txt . | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # Copy application files | |
| COPY main.py . | |
| COPY static/ ./static/ | |
| # Create necessary directories with proper permissions | |
| RUN mkdir -p uploads | |
| RUN mkdir -p data | |
| RUN chmod 777 uploads # Add permission for uploads directory | |
| RUN chmod 777 data # Pastikan direktori dapat ditulis | |
| # Expose port | |
| EXPOSE 7860 | |
| # Set environment variables | |
| ENV PYTHONUNBUFFERED=1 | |
| ENV PORT=7860 | |
| # Run the application | |
| CMD ["python", "main.py"] |