# Use a lightweight base image with Python FROM python:3.11-slim # Set environment variables for Hugging Face cache ENV TRANSFORMERS_CACHE=/tmp/huggingface/cache ENV HF_HOME=/tmp/huggingface/home # Create necessary directories for caching RUN mkdir -p $TRANSFORMERS_CACHE $HF_HOME # Set the working directory WORKDIR /app # Install necessary dependencies COPY requirements.txt . RUN pip install --upgrade pip && \ pip install --no-cache-dir -r requirements.txt && \ pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu # Copy your model files (ensure this path is correct) COPY flan-t5-small /models/flan-t5-small # Copy your application code COPY ./app . # Expose the port the app runs on EXPOSE 5005 # Command to run your application CMD ["uvicorn", "app.server:app", "--host", "0.0.0.0", "--port", "5005"]