harshnarayan12's picture
Upload 28 files
c27fe24 verified
# Hugging Face Spaces Dockerfile
FROM python:3.11-slim
# Set working directory
WORKDIR /app
# Install system dependencies
RUN apt-get update && apt-get install -y \
gcc \
g++ \
make \
libffi-dev \
libssl-dev \
ffmpeg \
git \
curl \
&& rm -rf /var/lib/apt/lists/*
# Set environment variables for Hugging Face Spaces
ENV PYTHONUNBUFFERED=1
ENV GRADIO_SERVER_NAME=0.0.0.0
ENV GRADIO_SERVER_PORT=7860
ENV HUGGINGFACE_SPACES=1
ENV FLASK_ENV=production
# Copy emergency requirements
COPY requirements_emergency.txt requirements.txt
# Install only 2 essential packages (ultra fast)
RUN pip install --no-cache-dir gradio==4.15.0 requests>=2.31.0
# Copy application code
COPY . .
# Create necessary directories
RUN mkdir -p logs data uploads chat_sessions survey_data processed_docs
# Set permissions
RUN chmod +x app*.py main.py fastapi_app.py
# Expose port for Gradio
EXPOSE 7860
# Health check
HEALTHCHECK --interval=30s --timeout=30s --start-period=60s --retries=3 \
CMD curl -f http://localhost:7860/ || exit 1
# Run the emergency application (guaranteed to work)
CMD ["python", "app_emergency.py"]