Update Dockerfile
Browse files- Dockerfile +13 -9
Dockerfile
CHANGED
|
@@ -1,14 +1,14 @@
|
|
| 1 |
# =============================================================================
|
| 2 |
-
# OCT-B agent — Hugging Face *Docker* Space
|
| 3 |
# =============================================================================
|
| 4 |
# Full model-driven sandbox variant: the agent gets shell + filesystem inside a
|
| 5 |
# UnixLocalSandboxClient and can author its own visualizations. No GPU here —
|
| 6 |
# inference is dispatched to the Modal workers behind the MCP servers.
|
| 7 |
#
|
| 8 |
# Build context = the Space repo root, which must contain:
|
| 9 |
-
# Dockerfile app.py requirements.txt README.md
|
|
|
|
| 10 |
# =============================================================================
|
| 11 |
-
|
| 12 |
# agentskills-core requires Python >=3.12 (<3.14), so the agent image uses
|
| 13 |
# 3.12-slim. The MCP server images can stay on 3.11 — they never import
|
| 14 |
# agentskills; only this orchestrator does.
|
|
@@ -21,15 +21,16 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
| 21 |
&& rm -rf /var/lib/apt/lists/*
|
| 22 |
|
| 23 |
# HF Docker Spaces run the container as uid 1000. Create a matching user with a
|
| 24 |
-
# writable home so pip --user installs and runtime temp writes
|
|
|
|
| 25 |
RUN useradd -m -u 1000 user
|
| 26 |
USER user
|
| 27 |
ENV HOME=/home/user \
|
| 28 |
PATH=/home/user/.local/bin:$PATH \
|
| 29 |
PYTHONUNBUFFERED=1 \
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
|
| 34 |
WORKDIR $HOME/app
|
| 35 |
|
|
@@ -37,10 +38,13 @@ WORKDIR $HOME/app
|
|
| 37 |
COPY --chown=user requirements.txt .
|
| 38 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 39 |
|
| 40 |
-
# Bring in app.py
|
|
|
|
| 41 |
COPY --chown=user . .
|
| 42 |
|
| 43 |
# HF Docker Spaces expose 7860 by convention (see app_port in README.md).
|
| 44 |
EXPOSE 7860
|
| 45 |
|
| 46 |
-
|
|
|
|
|
|
|
|
|
| 1 |
# =============================================================================
|
| 2 |
+
# OCT-B agent — Hugging Face *Docker* Space (Chainlit chat UI)
|
| 3 |
# =============================================================================
|
| 4 |
# Full model-driven sandbox variant: the agent gets shell + filesystem inside a
|
| 5 |
# UnixLocalSandboxClient and can author its own visualizations. No GPU here —
|
| 6 |
# inference is dispatched to the Modal workers behind the MCP servers.
|
| 7 |
#
|
| 8 |
# Build context = the Space repo root, which must contain:
|
| 9 |
+
# Dockerfile app.py requirements.txt README.md chainlit.md
|
| 10 |
+
# .chainlit/config.toml public/elements/OverlayFrame.jsx oct_b_agent/
|
| 11 |
# =============================================================================
|
|
|
|
| 12 |
# agentskills-core requires Python >=3.12 (<3.14), so the agent image uses
|
| 13 |
# 3.12-slim. The MCP server images can stay on 3.11 — they never import
|
| 14 |
# agentskills; only this orchestrator does.
|
|
|
|
| 21 |
&& rm -rf /var/lib/apt/lists/*
|
| 22 |
|
| 23 |
# HF Docker Spaces run the container as uid 1000. Create a matching user with a
|
| 24 |
+
# writable home so pip --user installs and runtime temp writes (Chainlit's
|
| 25 |
+
# .files/ and .chainlit/ live under the working dir) work.
|
| 26 |
RUN useradd -m -u 1000 user
|
| 27 |
USER user
|
| 28 |
ENV HOME=/home/user \
|
| 29 |
PATH=/home/user/.local/bin:$PATH \
|
| 30 |
PYTHONUNBUFFERED=1 \
|
| 31 |
+
OCT_OUT_DIR=/tmp/octb_out \
|
| 32 |
+
CHAINLIT_HOST=0.0.0.0 \
|
| 33 |
+
CHAINLIT_PORT=7860
|
| 34 |
|
| 35 |
WORKDIR $HOME/app
|
| 36 |
|
|
|
|
| 38 |
COPY --chown=user requirements.txt .
|
| 39 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 40 |
|
| 41 |
+
# Bring in app.py, the Chainlit assets (.chainlit/, public/, chainlit.md), and
|
| 42 |
+
# the unchanged oct_b_agent/ project.
|
| 43 |
COPY --chown=user . .
|
| 44 |
|
| 45 |
# HF Docker Spaces expose 7860 by convention (see app_port in README.md).
|
| 46 |
EXPOSE 7860
|
| 47 |
|
| 48 |
+
# Chainlit must be launched via its CLI (not `python app.py`). --headless keeps
|
| 49 |
+
# it from trying to open a browser; host/port also come from the env above.
|
| 50 |
+
CMD ["chainlit", "run", "app.py", "--host", "0.0.0.0", "--port", "7860", "--headless"]
|