| |
| FROM python:3.11-slim-bookworm |
|
|
| LABEL description="Dockerfile for Agent-Zero on Hugging Face Spaces" |
|
|
| |
| ENV DEBIAN_FRONTEND=noninteractive |
|
|
| |
| RUN apt-get update && apt-get install -y \ |
| git \ |
| curl \ |
| openssl \ |
| procps \ |
| zstd \ |
| build-essential \ |
| && rm -rf /var/lib/apt/lists/* |
|
|
| |
| RUN curl -LsSf https://astral.sh/uv/install.sh | sh |
| ENV PATH="/root/.local/bin:$PATH" |
|
|
| |
| RUN curl -fsSL https://ollama.com/install.sh | sh |
|
|
| |
| RUN git clone --branch fix-initialize-mcp-nameerror https://github.com/JsonLord/agent-zero.git /app |
|
|
| |
| COPY requirements.txt /app/requirements.txt |
| COPY run_ui.py /app/run_ui.py |
| COPY models.py /app/models.py |
| COPY whisper.py /app/python/helpers/whisper.py |
| COPY webui/js/api.js /app/webui/js/api.js |
| COPY webui/index.html /app/webui/index.html |
| COPY webui/js/index.js /app/webui/js/index.js |
| COPY preload.py /app/preload.py |
| COPY python/extensions/system_prompt/_10_system_prompt.py /app/python/extensions/system_prompt/_10_system_prompt.py |
| COPY python/helpers/searxng.py /app/python/helpers/searxng.py |
| COPY python/helpers/settings.py /app/python/helpers/settings.py |
| COPY python/helpers/csrf.py /app/python/helpers/csrf.py |
| COPY python/api/csrf_token.py /app/python/api/csrf_token.py |
| COPY start.sh /app/start.sh |
| COPY python/tools/search_engine.py /app/python/tools/search_engine.py |
| COPY initialize.py /app/initialize.py |
|
|
| |
| COPY python/api/health.py /app/python/api/health.py |
| COPY python/api/chat.py /app/python/api/chat.py |
| COPY python/api/stream.py /app/python/api/stream.py |
| COPY python/api/set.py /app/python/api/set.py |
| COPY python/api/get.py /app/python/api/get.py |
| COPY python/api/docs.py /app/python/api/docs.py |
|
|
| |
| COPY python/extensions/response_stream/_30_api_stream.py /app/python/extensions/response_stream/_30_api_stream.py |
| COPY python/extensions/reasoning_stream/_30_api_stream.py /app/python/extensions/reasoning_stream/_30_api_stream.py |
|
|
| |
| WORKDIR /app |
|
|
| |
| RUN echo "FLASK_SECRET_KEY=$(openssl rand -hex 32)" > .env |
|
|
| |
| RUN uv pip install --system --no-cache -r requirements.txt |
|
|
| |
| RUN python -m spacy download en_core_web_sm |
|
|
| |
| RUN groupadd -r ollama |
|
|
| |
| RUN useradd --create-home --shell /bin/bash user |
|
|
| |
| RUN usermod -aG ollama user |
|
|
| |
| RUN chown -R user:user /app |
|
|
| |
| RUN chmod +x /app/start.sh |
|
|
| |
| USER user |
|
|
| |
| WORKDIR /app |
|
|
| |
| EXPOSE 7860 |
|
|
| |
| CMD ["/app/start.sh"] |
|
|