|
| 1 | +# SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. |
| 2 | +# SPDX-License-Identifier: Apache-2.0 |
| 3 | +# |
| 4 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | +# you may not use this file except in compliance with the License. |
| 6 | +# You may obtain a copy of the License at |
| 7 | +# |
| 8 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | +# |
| 10 | +# Unless required by applicable law or agreed to in writing, software |
| 11 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | +# See the License for the specific language governing permissions and |
| 14 | +# limitations under the License. |
| 15 | + |
| 16 | +# Sandbox Agent Docker Image |
| 17 | +# This image provides a pre-configured environment for sandbox execution |
| 18 | +# with all necessary tools and libraries pre-installed. |
| 19 | + |
| 20 | +FROM python:3.12-slim |
| 21 | + |
| 22 | +# Metadata |
| 23 | +LABEL maintainer="NVIDIA Corporation" |
| 24 | +LABEL description="Sandbox Agent execution environment with Python, browser automation, and document generation tools" |
| 25 | + |
| 26 | +# Set environment variables |
| 27 | +ENV DEBIAN_FRONTEND=noninteractive |
| 28 | +ENV PYTHONUNBUFFERED=1 |
| 29 | +ENV PYTHONDONTWRITEBYTECODE=1 |
| 30 | + |
| 31 | +# Install system dependencies |
| 32 | +RUN apt-get update && apt-get install -y --no-install-recommends \ |
| 33 | + # Basic utilities |
| 34 | + curl \ |
| 35 | + wget \ |
| 36 | + git \ |
| 37 | + jq \ |
| 38 | + vim \ |
| 39 | + unzip \ |
| 40 | + # Network tools |
| 41 | + ca-certificates \ |
| 42 | + # Browser dependencies (for Playwright) |
| 43 | + libnss3 \ |
| 44 | + libnspr4 \ |
| 45 | + libdbus-1-3 \ |
| 46 | + libatk1.0-0 \ |
| 47 | + libatk-bridge2.0-0 \ |
| 48 | + libcups2 \ |
| 49 | + libdrm2 \ |
| 50 | + libxkbcommon0 \ |
| 51 | + libxcomposite1 \ |
| 52 | + libxdamage1 \ |
| 53 | + libxfixes3 \ |
| 54 | + libxrandr2 \ |
| 55 | + libgbm1 \ |
| 56 | + libasound2 \ |
| 57 | + libpango-1.0-0 \ |
| 58 | + libcairo2 \ |
| 59 | + # Fonts for document generation and browser |
| 60 | + fonts-liberation \ |
| 61 | + fonts-noto \ |
| 62 | + fonts-noto-cjk \ |
| 63 | + fonts-dejavu-core \ |
| 64 | + # Document generation dependencies |
| 65 | + pandoc \ |
| 66 | + # Clean up |
| 67 | + && apt-get clean \ |
| 68 | + && rm -rf /var/lib/apt/lists/* |
| 69 | + |
| 70 | +# Install Python packages |
| 71 | +RUN pip install --no-cache-dir --upgrade pip && \ |
| 72 | + pip install --no-cache-dir \ |
| 73 | + # Data processing |
| 74 | + pandas>=2.0.0 \ |
| 75 | + numpy>=1.24.0 \ |
| 76 | + matplotlib>=3.7.0 \ |
| 77 | + seaborn>=0.12.0 \ |
| 78 | + # Network requests |
| 79 | + requests>=2.31.0 \ |
| 80 | + httpx>=0.24.0 \ |
| 81 | + beautifulsoup4>=4.12.0 \ |
| 82 | + lxml>=4.9.0 \ |
| 83 | + # Browser automation |
| 84 | + playwright>=1.40.0 \ |
| 85 | + # Web search |
| 86 | + tavily-python>=0.5.0 \ |
| 87 | + # YouTube transcript |
| 88 | + youtube-transcript-api>=0.6.0 \ |
| 89 | + # Document generation |
| 90 | + python-pptx>=0.6.21 \ |
| 91 | + python-docx>=1.1.0 \ |
| 92 | + reportlab>=4.0.0 \ |
| 93 | + markdown>=3.5.0 \ |
| 94 | + # Excel support |
| 95 | + openpyxl>=3.1.0 \ |
| 96 | + xlrd>=2.0.0 \ |
| 97 | + # JSON/YAML |
| 98 | + pyyaml>=6.0.0 \ |
| 99 | + # Image processing |
| 100 | + pillow>=10.0.0 \ |
| 101 | + # Utilities |
| 102 | + aiofiles>=23.0.0 \ |
| 103 | + python-dateutil>=2.8.0 |
| 104 | + |
| 105 | +# Create shared directory for Playwright browsers (accessible by all users) |
| 106 | +ENV PLAYWRIGHT_BROWSERS_PATH=/opt/playwright-browsers |
| 107 | +RUN mkdir -p ${PLAYWRIGHT_BROWSERS_PATH} && chmod 755 ${PLAYWRIGHT_BROWSERS_PATH} |
| 108 | + |
| 109 | +# Install Playwright browser (Chromium only to reduce size) |
| 110 | +RUN playwright install chromium --with-deps |
| 111 | + |
| 112 | +# Create non-root user for security (created early so we can chown) |
| 113 | +RUN useradd -m -s /bin/bash sandbox |
| 114 | + |
| 115 | +# Change ownership of Playwright browsers to sandbox user |
| 116 | +RUN chown -R sandbox:sandbox ${PLAYWRIGHT_BROWSERS_PATH} |
| 117 | + |
| 118 | +# Create workspace directories |
| 119 | +RUN mkdir -p /workspace/input \ |
| 120 | + /workspace/output \ |
| 121 | + /workspace/temp \ |
| 122 | + /workspace/downloads |
| 123 | + |
| 124 | +# Set working directory |
| 125 | +WORKDIR /workspace |
| 126 | + |
| 127 | +# Set workspace ownership to sandbox user |
| 128 | +RUN chown -R sandbox:sandbox /workspace |
| 129 | + |
| 130 | +# Switch to non-root user |
| 131 | +USER sandbox |
| 132 | + |
| 133 | +# Default command - keep container running |
| 134 | +CMD ["/bin/bash"] |
0 commit comments