ameobius commited on
Commit
edc9a85
·
verified ·
1 Parent(s): e7bb2e5

Upload Dockerfile with huggingface_hub

Browse files
Files changed (1) hide show
  1. Dockerfile +47 -33
Dockerfile CHANGED
@@ -1,40 +1,54 @@
1
- FROM ubuntu:24.04
 
2
  ENV DEBIAN_FRONTEND=noninteractive
3
- ENV HOME=/home/ubuntu
4
 
 
5
  RUN apt-get update && apt-get install -y \
6
- curl sudo git wget build-essential python3 python3-pip python3-venv \
7
- vim nano tmux htop jq zip unzip less file \
8
- openssh-client net-tools iproute2 dnsutils \
9
- nodejs npm ca-certificates gnupg \
10
  && rm -rf /var/lib/apt/lists/*
11
 
 
12
  RUN curl -fsSL https://code-server.dev/install.sh | sh
13
 
14
- # Install Python packages
15
- RUN pip3 install --break-system-packages \
16
- requests httpx flask fastapi uvicorn pyyaml rich \
17
- huggingface_hub openai anthropic
18
-
19
- # Install Hermes Agent from GitHub
20
- RUN git clone --depth 1 https://github.com/NousResearch/hermes-agent.git /tmp/hermes && \
21
- cd /tmp/hermes && \
22
- pip3 install --break-system-packages -e . && \
23
- echo "hermes installed: $(which hermes 2>/dev/null || echo 'NOT_FOUND')" > /home/ubuntu/hermes_version.txt && \
24
- hermes --version >> /home/ubuntu/hermes_version.txt 2>&1 || \
25
- echo "hermes --version failed" >> /home/ubuntu/hermes_version.txt && \
26
- rm -rf /tmp/hermes
27
-
28
- # Create health check endpoint
29
- RUN echo '#!/bin/bash\necho "Content-Type: text/plain"\necho ""\ncat /home/ubuntu/hermes_version.txt 2>/dev/null || echo "no version file"\nwhich hermes 2>/dev/null || echo "hermes not in PATH"\npip3 list 2>/dev/null | grep -i hermes || echo "hermes not in pip"' > /home/ubuntu/health.sh && \
30
- chmod +x /home/ubuntu/health.sh
31
-
32
- RUN npm install -g npx yarn 2>/dev/null || true
33
-
34
- RUN echo "ubuntu ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
35
- RUN mkdir -p /home/ubuntu/workspace && chown -R ubuntu:ubuntu /home/ubuntu
36
-
37
- USER ubuntu
38
- WORKDIR /home/ubuntu/workspace
39
- EXPOSE 7860
40
- CMD ["code-server", "--bind-addr", "0.0.0.0:7860", "--auth", "password"]
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM ubuntu:22.04
2
+
3
  ENV DEBIAN_FRONTEND=noninteractive
 
4
 
5
+ # System packages: code-server + Python + tools
6
  RUN apt-get update && apt-get install -y \
7
+ python3 python3-pip \
8
+ git curl wget jq tmux \
9
+ nodejs npm \
10
+ httpie \
11
  && rm -rf /var/lib/apt/lists/*
12
 
13
+ # Install code-server
14
  RUN curl -fsSL https://code-server.dev/install.sh | sh
15
 
16
+ # Python packages
17
+ RUN pip3 install --no-cache-dir \
18
+ picoclaw==2026.3.20 \
19
+ httpx \
20
+ flask \
21
+ gunicorn
22
+
23
+ # Workspace
24
+ WORKDIR /app
25
+
26
+ # Create directory structure
27
+ RUN mkdir -p /app/kb /app/hooks /app/.picoclaw/workspace/sessions \
28
+ /app/.picoclaw/workspace/cron /app/hook_logs
29
+
30
+ # Copy KB files (served by built-in HTTP server on port 8811)
31
+ COPY kb/ /app/kb/
32
+
33
+ # Copy hook scripts
34
+ COPY hooks/ /app/hooks/
35
+ RUN chmod +x /app/hooks/*.py
36
+
37
+ # KB HTTP server (Flask on port 8811)
38
+ COPY kb_server.py /app/kb_server.py
39
+
40
+ # Picoclaw config generator
41
+ COPY gen_config.py /app/gen_config.py
42
+
43
+ # Startup script — runs code-server + KB server + picoclaw
44
+ COPY start.sh /app/start.sh
45
+ RUN chmod +x /app/start.sh
46
+
47
+ # Expose: 7860 (code-server), 8811 (KB server)
48
+ EXPOSE 7860 8811
49
+
50
+ # Health check — KB server
51
+ HEALTHCHECK --interval=120s --timeout=10s --retries=3 \
52
+ CMD curl -f http://localhost:8811/health || exit 1
53
+
54
+ CMD ["/app/start.sh"]