Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files12345678910111213141516171819202122232425262728293031323334FROM python:3.10-slim# Set environment variables for Hugging Face cacheENV HF_HOME=/code/hf_cacheENV TRANSFORMERS_CACHE=/code/hf_cacheENV PYTHONDONTWRITEBYTECODE=1ENV PYTHONUNBUFFERED=1# Create working directoryWORKDIR /code# System dependenciesRUN apt-get update && apt-get install -y \git \wget \build-essential \&& rm -rf /var/lib/apt/lists/*# Install Python packagesCOPY requirements.txt .RUN pip install --no-cache-dir --upgrade pip \&& pip install --no-cache-dir -r requirements.txt# Copy app codeCOPY . .# Create model cache directoryRUN mkdir -p /code/hf_cache# Expose FastAPI portEXPOSE 7860# Start the appCMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]1234567891011121314151617181920212223242526272829303132333435FROM python:3.10-slim# Set environment variables for Hugging Face cache# Before running your appENV HF_HOME=/app/hf_cacheENV TRANSFORMERS_CACHE=/app/hf_cacheENV XDG_CACHE_HOME=/app/hf_cacheRUN mkdir -p /app/hf_cache && chmod -R 777 /app/hf_cache# Create working directoryWORKDIR /code# System dependenciesRUN apt-get update && apt-get install -y \git \wget \build-essential \&& rm -rf /var/lib/apt/lists/*# Install Python packagesCOPY requirements.txt .RUN pip install --no-cache-dir --upgrade pip \&& pip install --no-cache-dir -r requirements.txt# Copy app codeCOPY . .# Create model cache directoryRUN mkdir -p /code/hf_cache# Expose FastAPI portEXPOSE 7860# Start the appCMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
Dockerfile+35-34