mirror of
https://github.com/yashshah9/agentbox.git
synced 2026-11-18 18:03:44 +00:00
Context: - Python-only subprocess runs were not enough for agent sandboxes. - Execute JavaScript, honor per-request timeouts, and ship a fetch-based TS client. Test Plan: - docker compose build test && docker compose run --rm test - POST /v1/run with language javascript and limits.timeout_seconds=1 Additional Notes: - Isolation is still subprocess, not gVisor.
20 lines
640 B
Docker
20 lines
640 B
Docker
FROM python:3.12-slim AS base
|
|
WORKDIR /app
|
|
ENV PYTHONDONTWRITEBYTECODE=1 PYTHONUNBUFFERED=1
|
|
RUN apt-get update && apt-get install -y --no-install-recommends nodejs && rm -rf /var/lib/apt/lists/*
|
|
|
|
FROM base AS dev
|
|
COPY pyproject.toml README.md ./
|
|
COPY src ./src
|
|
COPY tests ./tests
|
|
RUN pip install --no-cache-dir -e ".[dev]"
|
|
CMD ["pytest", "tests/", "-v"]
|
|
|
|
FROM base AS runtime
|
|
COPY pyproject.toml README.md ./
|
|
COPY src ./src
|
|
RUN pip install --no-cache-dir .
|
|
EXPOSE 8080
|
|
HEALTHCHECK CMD python -c "import urllib.request; urllib.request.urlopen('http://127.0.0.1:8080/health')"
|
|
CMD ["agentbox", "serve", "--host", "0.0.0.0", "--port", "8080"]
|