Neerajkadari's picture
Update Dockerfile
f96309d verified
Raw History Blame Contribute Delete
703 Bytes
FROM python:3.11-slim
WORKDIR /app
# Install system dependencies
RUN apt-get update && apt-get install -y git && rm -rf /var/lib/apt/lists/*
# Copy requirements first for better caching
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Copy all application files
COPY . .
# Download models from Hugging Face Hub using inline Python
RUN python -c "from huggingface_hub import snapshot_download; snapshot_download(repo_id='Neerajkadari/my_project_models', repo_type='model', local_dir='/app/downloaded_models', force_download=False)"
# Expose port
EXPOSE 7860
# Set environment
ENV HOST=0.0.0.0
ENV PORT=7860
ENV PYTHONUNBUFFERED=1
# Run the app
CMD ["python", "app.py"]