# Use Python 3.9 FROM python:3.9 # Set up work directory WORKDIR /code # Install dependencies COPY requirements.txt . RUN pip install --no-cache-dir --upgrade -r requirements.txt # Copy all files (including server.py and ingest script) COPY . . # 1. FIX PERMISSIONS (Crucial for Hugging Face) # This creates a folder and makes sure the app can write to it RUN mkdir -p /code/quran_db && chmod -R 777 /code # 2. BUILD THE DATABASE NOW # We run the script during the build so the DB is ready when the app starts # Change 'ingest_multilingual.py' to whatever your script name is RUN python ingest_multilingual.py # 3. Start the Server CMD ["uvicorn", "server:app", "--host", "0.0.0.0", "--port", "7860"]