quickdraw-api / Dockerfile
issaennab
Deploy QuickDraw API with trained model and comprehensive logging
d2a2955
raw
history blame contribute delete
753 Bytes
# Hugging Face Space Dockerfile for QuickDraw API
FROM python:3.10-slim
# Create user
RUN useradd -m -u 1000 user
USER user
ENV PATH="/home/user/.local/bin:$PATH"
WORKDIR /app
# Install system dependencies
USER root
RUN apt-get update && apt-get install -y \
libgomp1 \
curl \
&& rm -rf /var/lib/apt/lists/*
USER user
# Copy requirements and install
COPY --chown=user ./requirements.txt requirements.txt
RUN pip install --no-cache-dir --upgrade -r requirements.txt
# Copy application files
COPY --chown=user . /app
# Create directories for logs
RUN mkdir -p api_logs/received_images
# Expose port 7860 (required by HF Spaces)
EXPOSE 7860
# Start the API on port 7860
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]