Spaces:
Sleeping
Sleeping
File size: 1,073 Bytes
db9ee96 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 | # Dockerfile for Hugging Face Spaces
FROM python:3.11-slim
# Create a non-root user
RUN useradd -m -u 1000 user
USER user
ENV PATH="/home/user/.local/bin:$PATH"
WORKDIR /app
# Install system dependencies for llama-cpp-python
USER root
RUN apt-get update && apt-get install -y \
build-essential \
cmake \
git \
curl \
&& rm -rf /var/lib/apt/lists/*
USER user
# Copy requirements and install Python dependencies
COPY --chown=user requirements.txt .
RUN pip install --no-cache-dir --upgrade -r requirements.txt
# Copy application files
COPY --chown=user resume_microservice.py .
COPY --chown=user download_model.py .
# Create necessary directories
RUN mkdir -p /tmp/uploads resume_parser/models
# Expose port 7860 (required by Hugging Face Spaces)
EXPOSE 7860
# Set environment variables
ENV FLASK_RUN_HOST=0.0.0.0
ENV FLASK_RUN_PORT=7860
# Health check
HEALTHCHECK --interval=30s --timeout=30s --start-period=300s --retries=3 \
CMD curl -f http://localhost:7860/health || exit 1
# Start the application
CMD ["python", "resume_microservice.py"] |