File size: 1,434 Bytes
f3d33c3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
# GPU-enabled sandbox for AI agents
# Base: NVIDIA CUDA with Python support
FROM nvidia/cuda:12.4.1-cudnn-runtime-ubuntu22.04

# Prevent interactive prompts during package installation
ENV DEBIAN_FRONTEND=noninteractive

# Install Python 3.12 and Dev Mode required packages
RUN apt-get update && \
    apt-get install -y \
      software-properties-common && \
    add-apt-repository -y ppa:deadsnakes/ppa && \
    apt-get update && \
    apt-get install -y \
      python3.12 \
      python3.12-venv \
      python3.12-dev \
      python3-pip \
      bash \
      git git-lfs \
      wget curl procps \
      htop vim nano \
      jq \
      tmux \
      build-essential \
      openssh-client && \
    rm -rf /var/lib/apt/lists/*

# Set Python 3.12 as default
RUN update-alternatives --install /usr/bin/python python /usr/bin/python3.12 1 && \
    update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.12 1

# Set up user with uid 1000 (required for Dev Mode)
RUN useradd -m -u 1000 user
USER user

ENV HOME=/home/user \
    PATH=/home/user/.local/bin:$PATH \
    CUDA_HOME=/usr/local/cuda \
    LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH

# Install uv (fast Python package manager) for user
RUN curl -LsSf https://astral.sh/uv/install.sh | sh

WORKDIR /app
COPY --chown=user . /app

EXPOSE 7860

# Just keep the container alive - agent uses SSH to interact
CMD ["python", "-m", "http.server", "7860"]