Spaces:
Sleeping
Sleeping
File size: 812 Bytes
59cece6 | 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 | # Base Image
FROM python:3.9-slim
# Working Directory
WORKDIR /app
# System Dependencies (minimal)
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
curl \
&& rm -rf /var/lib/apt/lists/*
# Copy Requirements
COPY requirements.txt .
# Install Python Dependencies
RUN pip install --no-cache-dir -r requirements.txt
# Download Spacy Model (Required for NLP)
RUN python -m spacy download en_core_web_sm
# Copy Application Code
COPY . .
# Environment Variables
ENV API_URL="http://127.0.0.1:8000"
# HuggingFace Spaces requires port 7860
ENV PORT=7860
ENV PYTHONPATH="${PYTHONPATH}:/app/src"
ENV PYTHONUNBUFFERED=1
# Expose Port for HuggingFace Spaces
EXPOSE 7860
# Entrypoint Script
COPY entrypoint.sh .
RUN chmod +x entrypoint.sh
# Run
CMD ["./entrypoint.sh"]
|