Hoghoghi / Dockerfile
Really-amin's picture
Upload 66 files
4e7b77b verified
raw
history blame
891 Bytes
FROM python:3.10-slim
WORKDIR /app
# Install required system packages
RUN apt-get update && apt-get install -y \
build-essential \
poppler-utils \
tesseract-ocr \
libgl1 \
curl \
&& rm -rf /var/lib/apt/lists/*
# Create volume-safe directories with proper permissions
RUN mkdir -p /app/data /app/cache && chmod -R 777 /app/data /app/cache
# Set environment variables for Hugging Face cache and database
ENV TRANSFORMERS_CACHE=/app/cache
ENV HF_HOME=/app/cache
ENV DATABASE_PATH=/app/data/legal_dashboard.db
# Copy all project files
COPY . .
# Make startup script executable
RUN chmod +x start.sh
# Install Python dependencies
RUN pip install --no-cache-dir -r requirements.txt
# Ensure data directory permissions are correct
RUN chmod -R 777 /app/data
EXPOSE 7860
# Run FastAPI app using startup script
CMD ["./start.sh"]