Pulastya0's picture
Update Dockerfile
7927511 verified
raw
history blame contribute delete
711 Bytes
# Use official Python base
FROM python:3.11-slim
# Set working directory
WORKDIR /app
# Set locales and UTF-8
ENV LANG=C.UTF-8
ENV LC_ALL=C.UTF-8
# Set Hugging Face cache
ENV HF_HOME="/tmp/huggingface"
ENV HF_DATASETS_CACHE="/tmp/huggingface"
ENV TRANSFORMERS_CACHE="/tmp/huggingface"
# Install system dependencies
RUN apt-get update && \
apt-get install -y --no-install-recommends git build-essential && \
rm -rf /var/lib/apt/lists/*
# Copy requirements
COPY requirements.txt .
# Install Python dependencies
RUN pip install --no-cache-dir -r requirements.txt
# Copy app files
COPY . .
# Expose port
EXPOSE 7860
# Start Uvicorn
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]