Princess3 commited on
Commit
8c6ea46
·
verified ·
1 Parent(s): d3238bc

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +35 -3
Dockerfile CHANGED
@@ -1,4 +1,36 @@
1
- # Use the official Agent Zero image as the base
2
- FROM agent0ai/agent-zero:latest
3
- CMD agent0ai/agent-zero
4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Use a lightweight Python base
2
+ FROM python:3.11-slim
 
3
 
4
+ # Set up a new user to comply with Hugging Face's security policy
5
+ RUN useradd -m -u 1000 user
6
+ USER user
7
+ ENV PATH="/home/user/.local/bin:${PATH}"
8
+
9
+ WORKDIR /home/user/app
10
+
11
+ # Install system dependencies
12
+ USER root
13
+ RUN apt-get update && apt-get install -y \
14
+ git \
15
+ curl \
16
+ && rm -rf /var/lib/apt/lists/*
17
+ USER user
18
+
19
+ # Clone the Agent Zero repository
20
+ RUN git clone https://github.com/frdel/agent-zero.git .
21
+
22
+ # Install Python dependencies
23
+ RUN pip install --no-cache-dir -r requirements.txt
24
+
25
+ # Create necessary directories for persistence and logs
26
+ RUN mkdir -p /home/user/app/workspaces /home/user/app/logs
27
+
28
+ # Expose the port (Hugging Face Spaces usually use 7860)
29
+ EXPOSE 7860
30
+
31
+ # Set environment variables (Can also be set in HF Space Settings)
32
+ ENV PYTHONUNBUFFERED=1
33
+
34
+ # Command to run the agent
35
+ # Note: You may need to modify the entry point depending on how you want to interact (CLI vs API)
36
+ CMD ["python", "main.py"]