Spaces:
				
			
			
	
			
			
					
		Running
		
	
	
	
			
			
	
	
	
	
		
		
					
		Running
		
	File size: 1,682 Bytes
			
			| 3090f9e 78d0662 3090f9e bbb7f50 db09312 c51231e bbb7f50 db09312 b629af9 9e37bf9 3090f9e 4cf775b 88e2aa1 3090f9e 88e2aa1 3090f9e 6b467f1 3090f9e 88e2aa1 3090f9e 593673c | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 | # Use an official Python runtime as a parent image
FROM python:3.11-slim
# Set environment variables for Python
ENV PYTHONDONTWRITEBYTECODE=1 \
    PYTHONUNBUFFERED=1
# Set environment variables for Hugging Face cache
ENV TRANSFORMERS_CACHE=/app/cache \
    HF_HOME=/app/cache
    
ENV MPLCONFIGDIR=/tmp
# Set the working directory
WORKDIR /app
# Install system dependencies
RUN apt-get update && apt-get install -y \
    libgl1 \
    libglib2.0-0 \
    libsm6 \
    libxrender1 \
    libxext6 \
    file \
    && rm -rf /var/lib/apt/lists/*
#adding the poppler 
RUN apt-get update && apt-get install -y poppler-utils
#adding the poppler 
RUN apt-get update && apt-get install -y tesseract-ocr
# Copy the requirements file into the container at /app
COPY requirements.txt /app/
# Install dependencies 
RUN pip install --no-cache-dir -r requirements.txt
# Create and set permissions for the cache directory
RUN mkdir -p /app/cache /app/VectorDB /app/TableDB /app/uploads /app/nltk_data /nltk_data && \ 
    chmod -R 777 /app/cache /app/VectorDB /app/TableDB /app/uploads /app/nltk_data /nltk_data
# Ensure all relevant directories have the correct permissions
RUN chmod -R 777 /app/VectorDB
RUN chmod -R 777 /app/TableDB
RUN chmod -R 777 /app/uploads
RUN chmod -R 777 /app/nltk_data
RUN chmod -R 777 /nltk_data
RUN chmod -R 777 /app
RUN chmod -R 777 /app/TableDB
# Copy the rest of the application code to /app
COPY . /app/
# Set environment variables for Flask
ENV FLASK_APP=app.py \
    FLASK_ENV=production
# Expose the port the app runs on
EXPOSE 7860
# Command to run the application
CMD ["gunicorn", "-w", "1", "-b", "0.0.0.0:7860", "--timeout", "360", "app:app"] |