CardProcessor-Pro / Dockerfile
Devashishraghav's picture
Upload Dockerfile with huggingface_hub
99dd056 verified
raw
history blame contribute delete
654 Bytes
FROM python:3.11-slim
# System dependencies for OpenCV
RUN apt-get update && apt-get install -y --no-install-recommends \
libgl1-mesa-glx \
libglib2.0-0 \
&& rm -rf /var/lib/apt/lists/*
# HF Spaces requires a non-root user
RUN useradd -m -u 1000 user
USER user
ENV PATH="/home/user/.local/bin:$PATH"
WORKDIR /app
# Install Python dependencies
COPY --chown=user requirements.txt .
RUN pip install --no-cache-dir --user -r requirements.txt
# Copy application code
COPY --chown=user . .
# HF Spaces uses port 7860
EXPOSE 7860
# Start the server
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]