-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
85 lines (69 loc) · 2.92 KB
/
Dockerfile
File metadata and controls
85 lines (69 loc) · 2.92 KB
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
FROM python:3.12-slim AS base
# System deps
RUN apt-get update && apt-get install -y --no-install-recommends \
git curl ca-certificates build-essential gettext-base \
&& rm -rf /var/lib/apt/lists/*
# Create non-root sandbox user
ARG SANDBOX_UID=1001
RUN useradd -m -s /bin/bash -u ${SANDBOX_UID} sandbox
# Node.js (for agent-browser)
RUN apt-get update && apt-get install -y --no-install-recommends \
nodejs npm \
&& rm -rf /var/lib/apt/lists/*
# Browser tool: agent-browser + Chromium
RUN npm install -g agent-browser \
&& (agent-browser install --with-deps 2>/dev/null \
|| (apt-get update && apt-get install -y --no-install-recommends chromium && rm -rf /var/lib/apt/lists/*))
# Install nanobot from submodule + Python deps
COPY nanobot/ /opt/nanobot/
RUN pip install --no-cache-dir /opt/nanobot/ \
gradio sqlite-vec httpx uvicorn langfuse prometheus-client PyMuPDF pyyaml \
langchain langchain-openai langgraph websockets
# Install protoResearcher
COPY tools/ /opt/protoresearcher/tools/
COPY knowledge/ /opt/protoresearcher/knowledge/
COPY lab/ /opt/protoresearcher/lab/
COPY graph/ /opt/protoresearcher/graph/
COPY skills/ /opt/protoresearcher/skills/
COPY audit.py /opt/protoresearcher/audit.py
COPY tracing.py /opt/protoresearcher/tracing.py
COPY metrics.py /opt/protoresearcher/metrics.py
COPY chat_ui.py /opt/protoresearcher/chat_ui.py
COPY server.py /opt/protoresearcher/server.py
COPY discord_bot.py /opt/protoresearcher/discord_bot.py
COPY guardrails.py /opt/protoresearcher/guardrails.py
COPY entrypoint.sh /opt/protoresearcher/entrypoint.sh
COPY config/ /opt/protoresearcher/config/
COPY static/ /opt/protoresearcher/static/
# Sandbox workspace + knowledge/audit/papers dirs
RUN mkdir -p /sandbox /tmp/sandbox /sandbox/audit /sandbox/knowledge /sandbox/papers \
&& chown -R sandbox:sandbox /sandbox /tmp/sandbox
# Persistent dirs (volumes mounted at runtime)
RUN mkdir -p /opt/.cron \
&& chown -R sandbox:sandbox /opt/.cron
# Nanobot data dir
RUN mkdir -p /home/sandbox/.nanobot \
&& chown -R sandbox:sandbox /home/sandbox/.nanobot
# Drop to sandbox user
USER sandbox
WORKDIR /sandbox
EXPOSE 7870
CMD ["/opt/protoresearcher/entrypoint.sh"]
# ---------------------------------------------------------------------------
# Lab stage — adds torch + LLaMA-Factory deps for GPU training
# Usage: docker compose --profile lab up --build
# ---------------------------------------------------------------------------
FROM base AS lab
USER root
# Install PyTorch (CUDA 12.8) + training deps
RUN pip install --no-cache-dir \
torch==2.9.1 --index-url https://download.pytorch.org/whl/cu128 \
&& pip install --no-cache-dir \
transformers accelerate peft trl datasets bitsandbytes
# Lab workspace
RUN mkdir -p /sandbox/lab /mnt/data/training/researcher \
&& chown -R sandbox:sandbox /sandbox/lab /mnt/data/training/researcher
USER sandbox
WORKDIR /sandbox
EXPOSE 7870
CMD ["/opt/protoresearcher/entrypoint.sh"]