File size: 975 Bytes
8c6ea46
 
ff42ffc
8c6ea46
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
# Use a lightweight Python base
FROM python:3.11-slim

# Set up a new user to comply with Hugging Face's security policy
RUN useradd -m -u 1000 user
USER user
ENV PATH="/home/user/.local/bin:${PATH}"

WORKDIR /home/user/app

# Install system dependencies
USER root
RUN apt-get update && apt-get install -y \
    git \
    curl \
    && rm -rf /var/lib/apt/lists/*
USER user

# Clone the Agent Zero repository
RUN git clone https://github.com/frdel/agent-zero.git .

# Install Python dependencies
RUN pip install --no-cache-dir -r requirements.txt

# Create necessary directories for persistence and logs
RUN mkdir -p /home/user/app/workspaces /home/user/app/logs

# Expose the port (Hugging Face Spaces usually use 7860)
EXPOSE 7860

# Set environment variables (Can also be set in HF Space Settings)
ENV PYTHONUNBUFFERED=1

# Command to run the agent
# Note: You may need to modify the entry point depending on how you want to interact (CLI vs API)
CMD ["python", "main.py"]