nexa-classify-api / Dockerfile
Prototype6239's picture
Upload folder using huggingface_hub
a229747 verified
Raw
History Blame Contribute Delete
696 Bytes
FROM python:3.11-slim
# Install system dependencies (needed for git-lfs and health checks)
RUN apt-get update && apt-get install -y --no-install-recommends \
curl \
git \
git-lfs \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
# Copy requirements and install torch CPU version
COPY requirements.txt .
RUN pip install --no-cache-dir torch --index-url https://download.pytorch.org/whl/cpu
RUN pip install --no-cache-dir -r requirements.txt
# Copy all source files
COPY . .
# Create logs directory
RUN mkdir -p logs
# Expose the default port for Hugging Face Spaces
EXPOSE 7860
# Run uvicorn server on port 7860
CMD ["uvicorn", "api:app", "--host", "0.0.0.0", "--port", "7860"]