nevergiveup / Dockerfile
DIVYA-NSHU99's picture
Initial deployment
d0bbfa9
# ── Base image ────────────────────────────────────────────
FROM python:3.10-slim
# ── System dependencies ───────────────────────────────────
RUN apt-get update && apt-get install -y \
build-essential \
git \
&& rm -rf /var/lib/apt/lists/*
# ── Create non-root user (required by HF Spaces) ─────────
RUN useradd -m -u 1000 user
USER user
# ── Set environment paths ─────────────────────────────────
ENV HOME=/home/user \
PATH=/home/user/.local/bin:$PATH \
PYTHONPATH=/home/user/app/conflict_check \
SENTENCE_TRANSFORMERS_HOME=/home/user/.cache/sentence_transformers \
HF_HOME=/home/user/.cache/huggingface
# ── Set working directory ─────────────────────────────────
WORKDIR /home/user/app
# ── Copy and install requirements first (layer caching) ───
COPY --chown=user requirements.txt .
RUN pip install --no-cache-dir --upgrade pip \
&& pip install --no-cache-dir -r requirements.txt
# ── Copy entire project ───────────────────────────────────
COPY --chown=user . .
# ── Create folders the app writes to at runtime ──────────
RUN mkdir -p /home/user/app/conflict_check/search_data \
&& mkdir -p /home/user/app/conflict_check/analysis_output
# ── Expose Gradio default port ────────────────────────────
EXPOSE 7860
# ── Launch Gradio app ─────────────────────────────────────
CMD ["python", "conflict_check/gradio_app.py"]