agent-memory / Dockerfile
eriquesouza
Preparar deploy no Hugging Face Spaces.
2f56bf2
Raw
History Blame Contribute Delete
527 Bytes
FROM python:3.11-slim
WORKDIR /app
# HF Spaces roda como usuário não-root; caches devem ir para /tmp.
ENV PORT=7860 \
CHROMA_PERSIST_DIR=/tmp/chroma_db \
HF_HOME=/tmp/hf_home \
TRANSFORMERS_CACHE=/tmp/hf_home \
SENTENCE_TRANSFORMERS_HOME=/tmp/hf_home \
XDG_CACHE_HOME=/tmp/cache \
PYTHONUNBUFFERED=1 \
PYTHONDONTWRITEBYTECODE=1
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY . .
EXPOSE 7860
CMD ["sh", "-c", "uvicorn main:app --host 0.0.0.0 --port ${PORT}"]