CoolFace
Apppublic

kushvanth/iqac_fast_api

sourceHugging Faceupdated 10mo agoView on Hugging Face
1likes
Dockerfile31 linesDownload Raw Back to root
1FROM python:3.12-slim2 3WORKDIR /app4 5# Set environment variables for cache directories6ENV HF_HOME=/tmp/huggingface7ENV TRANSFORMERS_CACHE=/tmp/huggingface/transformers8ENV HF_DATASETS_CACHE=/tmp/huggingface/datasets9 10# Upgrade pip11RUN python -m pip install --upgrade pip12 13# Copy dependencies and install14COPY requirements.txt .15RUN pip install --no-cache-dir -r requirements.txt16 17# Download NLTK data to /tmp18RUN python -m nltk.downloader -d /tmp/nltk_data vader_lexicon punkt stopwords wordnet omw-1.419 20# Copy application code21COPY . .22 23# Create cache directories with proper permissions24RUN mkdir -p /tmp/huggingface /tmp/model_cache /tmp/nltk_data && \25    chmod -R 777 /tmp/huggingface /tmp/model_cache /tmp/nltk_data26 27# Expose port 786028EXPOSE 786029 30# Run FastAPI31CMD ["uvicorn", "fastapi_example:app", "--host", "0.0.0.0", "--port", "7860"]