Cowagent / Dockerfile
Nerdur's picture
Upload 6 files
b198e76 verified
Raw
History Blame Contribute Delete
1.83 kB
# ── Base image ────────────────────────────────────────────────────────────────
FROM python:3.11-slim
# ── System deps ───────────────────────────────────────────────────────────────
RUN apt-get update && apt-get install -y --no-install-recommends \
git curl ca-certificates ffmpeg libmagic1 \
&& rm -rf /var/lib/apt/lists/*
# ── Non-root user required by Hugging Face Spaces ─────────────────────────────
RUN useradd -m -u 1000 cow
WORKDIR /app
# ── Clone CowAgent source ─────────────────────────────────────────────────────
RUN git clone --depth=1 https://github.com/zhayujie/CowAgent.git /app
# ── Python deps ───────────────────────────────────────────────────────────────
COPY requirements-hf.txt /app/requirements-hf.txt
RUN pip install --no-cache-dir -r /app/requirements-hf.txt
# ── Entrypoint, config & CSS patches ──────────────────────────────────────────
COPY entrypoint.sh /app/entrypoint.sh
COPY mobile-fix.css /app/mobile-fix.css
RUN chmod +x /app/entrypoint.sh
# HF Spaces persists /data across restarts
RUN mkdir -p /data/cow && chown -R cow:cow /data /app
USER cow
# HF Spaces always uses port 7860
EXPOSE 7860
CMD ["/app/entrypoint.sh"]