likhonsheikh commited on
Commit
83ec3bc
·
verified ·
1 Parent(s): 4d17f5e

🚀 MINIMAL BUILD FIX: Use minimal Dockerfile with python:3.11-slim base

Browse files
Files changed (1) hide show
  1. Dockerfile +13 -796
Dockerfile CHANGED
@@ -1,809 +1,26 @@
1
- # Ubuntu Sandbox Environment for HuggingFace Spaces
2
- # A comprehensive development environment accessible by AI models
3
-
4
- FROM ubuntu:22.04
5
-
6
- # Avoid interactive prompts during package installation
7
- ENV DEBIAN_FRONTEND=noninteractive
8
- ENV PYTHONPATH=/home/user/workspace
9
- ENV PATH=/home/user/workspace/.local/bin:$PATH
10
 
11
  # Set working directory
12
  WORKDIR /home/user/workspace
13
 
14
- # Update and upgrade system
15
- RUN apt-get update && apt-get upgrade -y
16
-
17
- # Install essential system packages
18
- RUN apt-get install -y \
19
- # Core system utilities
20
- curl \
21
- wget \
22
  git \
23
- vim \
24
- nano \
25
- htop \
26
- tree \
27
- jq \
28
- unzip \
29
- zip \
30
- tar \
31
- gzip \
32
- build-essential \
33
- software-properties-common \
34
- apt-transport-https \
35
- ca-certificates \
36
- gnupg \
37
- lsb-release \
38
-
39
- # Development tools
40
- python3-dev \
41
- python3-pip \
42
- python3-venv \
43
- python3-setuptools \
44
- python3-wheel \
45
- gcc \
46
- g++ \
47
- make \
48
- cmake \
49
- ninja-build \
50
- pkg-config \
51
- autoconf \
52
- automake \
53
- libtool \
54
- flex \
55
- bison \
56
-
57
- # Version control and collaboration
58
- subversion \
59
- mercurial \
60
- git-lfs \
61
-
62
- # Text processing and editors
63
- sed \
64
- awk \
65
- grep \
66
- find \
67
- cat \
68
- head \
69
- tail \
70
- sort \
71
- uniq \
72
- wc \
73
- cut \
74
- tr \
75
- \
76
- # System monitoring
77
- strace \
78
- ltrace \
79
- sysstat \
80
- iotop \
81
- iftop \
82
- \
83
- # Networking tools
84
- net-tools \
85
- iputils-ping \
86
- telnet \
87
- nc \
88
- netcat-openbsd \
89
- socat \
90
  curl \
91
  wget \
92
- dnsutils \
93
- \
94
- # Compression and archiving
95
- bzip2 \
96
- xz-utils \
97
- p7zip-full \
98
- p7zip-rar \
99
- rar \
100
- unrar \
101
- \
102
- # Development libraries
103
- libssl-dev \
104
- libffi-dev \
105
- libxml2-dev \
106
- libxslt1-dev \
107
- zlib1g-dev \
108
- libjpeg-dev \
109
- libpng-dev \
110
- libfreetype6-dev \
111
- liblcms2-dev \
112
- libwebp-dev \
113
- tcl8.6-dev \
114
- tk8.6-dev \
115
- python3-tk \
116
- \
117
- # Database clients
118
- sqlite3 \
119
- libsqlite3-dev \
120
- postgresql-client \
121
- mysql-client \
122
- \
123
- # Additional development tools
124
- shellcheck \
125
- pylint \
126
- flake8 \
127
- black \
128
- isort \
129
- mypy \
130
- pytest \
131
- pytest-cov \
132
- coverage \
133
- bandit \
134
- safety \
135
- pipenv \
136
- poetry \
137
- \
138
- # Documentation tools
139
- pandoc \
140
- texlive-latex-base \
141
- texlive-fonts-recommended \
142
- \
143
- # Data science and ML tools
144
- libhdf5-dev \
145
- libatlas-base-dev \
146
- gfortran \
147
- libopenblas-dev \
148
- liblapack-dev \
149
- cython \
150
- \
151
- # Other useful tools
152
- dos2unix \
153
- dos2unix \
154
- jq \
155
- \
156
- # Clean up
157
- && apt-get clean \
158
  && rm -rf /var/lib/apt/lists/*
159
 
160
- # Install Node.js and npm for web development
161
- RUN curl -fsSL https://deb.nodesource.com/setup_18.x | bash - \
162
- && apt-get install -y nodejs
163
-
164
- # Install additional Python packages via pip
165
- RUN pip3 install --upgrade pip setuptools wheel
166
-
167
- # Create user directory structure
168
- RUN mkdir -p /home/user/workspace/{projects,data,temp,logs,tools,scripts}
169
-
170
- # Set up .bashrc with useful aliases and functions
171
- RUN cat >> /home/user/.bashrc << 'EOF'
172
-
173
- # Ubuntu Sandbox Environment Configuration
174
- export PS1='\[\033[01;32m\]\u@\[\033[01;34m\]\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
175
- export EDITOR=vim
176
- export PYTHONPATH=/home/user/workspace
177
- export PATH=/home/user/workspace/.local/bin:$PATH
178
-
179
- # Useful aliases
180
- alias ll='ls -la'
181
- alias la='ls -A'
182
- alias l='ls -CF'
183
- alias ..='cd ..'
184
- alias ...='cd ../..'
185
- alias grep='grep --color=auto'
186
- alias fgrep='fgrep --color=auto'
187
- alias egrep='egrep --color=auto'
188
- alias h='history'
189
- alias j='jobs'
190
- alias which='type -a'
191
- alias ..='cd ..'
192
- alias ...='cd ../..'
193
- alias ....='cd ../../..'
194
- alias .....='cd ../../../..'
195
- alias path='echo -e ${PATH//:/\\n}'
196
- alias now='date +"%Y-%m-%d %H:%M:%S"'
197
- alias ports='netstat -tulpn'
198
-
199
- # Functions
200
- function mkcd() { mkdir -p "$1" && cd "$1"; }
201
- function extract() {
202
- if [ -f $1 ]; then
203
- case $1 in
204
- *.tar.bz2) tar xjf $1 ;;
205
- *.tar.gz) tar xzf $1 ;;
206
- *.bz2) bunzip2 $1 ;;
207
- *.rar) unrar x $1 ;;
208
- *.gz) gunzip $1 ;;
209
- *.tar) tar xf $1 ;;
210
- *.tbz2) tar xjf $1 ;;
211
- *.tgz) tar xzf $1 ;;
212
- *.zip) unzip $1 ;;
213
- *.Z) uncompress $1 ;;
214
- *.7z) 7z x $1 ;;
215
- *) echo "'$1' cannot be extracted via extract()" ;;
216
- esac
217
- else
218
- echo "'$1' is not a valid file"
219
- fi
220
- }
221
-
222
- # AI-friendly environment
223
- export AI_SANDBOX=1
224
- export BUILD_ENV=1
225
- export SHIP_ENV=1
226
- export CREATE_ENV=1
227
-
228
- echo "🚀 Ubuntu Sandbox Environment Ready!"
229
- echo "🤖 AI Models can now build, ship, and create anything!"
230
- echo "📁 Current directory: $(pwd)"
231
- echo "🐍 Python: $(python3 --version)"
232
- echo "📊 Workspace: /home/user/workspace"
233
- echo "Use 'help' command to see available features."
234
- EOF
235
-
236
- # Set up git configuration
237
- RUN git config --global user.name "AI Agent" \
238
- && git config --global user.email "ai@ubuntu-sandbox.local" \
239
- && git config --global init.defaultBranch main \
240
- && git config --global color.ui auto
241
-
242
- # Create sample projects and documentation
243
- RUN mkdir -p /home/user/workspace/projects/sample_project \
244
- && echo "# Sample Project" > /home/user/workspace/projects/sample_project/README.md \
245
- && echo "print('Hello from Ubuntu Sandbox!')" > /home/user/workspace/projects/sample_project/hello.py
246
-
247
- # Create a comprehensive tool installation script
248
- RUN cat > /home/user/workspace/install_tools.sh << 'EOF'
249
- #!/bin/bash
250
- # Tool Installation Script for Ubuntu Sandbox
251
-
252
- echo "🛠️ Installing additional development tools..."
253
-
254
- # Install Docker CLI (Docker Compose will be available via pip)
255
- if ! command -v docker &> /dev/null; then
256
- curl -fsSL https://get.docker.com -o get-docker.sh
257
- sh get-docker.sh
258
- usermod -aG docker user 2>/dev/null || true
259
- rm get-docker.sh
260
- fi
261
-
262
- # Install Kubernetes tools
263
- curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
264
- chmod +x kubectl
265
- mv kubectl /usr/local/bin/
266
-
267
- # Install Helm
268
- curl https://baltocdn.com/helm/signing.asc | gpg --dearmor | tee /usr/share/keyrings/helm.gpg > /dev/null
269
- echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/helm.gpg] https://baltocdn.com/helm/stable/debian/ all main" | tee /etc/apt/sources.list.d/helm-stable-debian.list
270
- apt-get update
271
- apt-get install helm
272
-
273
- # Install Terraform
274
- wget -O- https://apt.releases.hashicorp.com/gpg | gpg --dearmor | tee /usr/share/keyrings/hashicorp-archive-keyring.gpg
275
- echo "deb [signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] https://apt.releases.hashicorp.com $(lsb_release -cs) main" | tee /etc/apt/sources.list.d/hashicorp.list
276
- apt-get update && apt-get install terraform
277
-
278
- # Install AWS CLI
279
- curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
280
- unzip awscliv2.zip
281
- ./aws/install
282
- rm -rf aws awscliv2.zip
283
-
284
- # Install Google Cloud SDK
285
- echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages.cloud.google.com/apt cloud-sdk main" | tee -a /etc/apt/sources.list.d/google-cloud-sdk.list
286
- curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | gpg --dearmor -o /usr/share/keyrings/cloud.google.gpg
287
- apt-get update && apt-get install google-cloud-cli
288
-
289
- # Install Azure CLI
290
- curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash
291
-
292
- # Install useful development tools
293
- pip3 install \
294
- docker-compose \
295
- terraform-docs \
296
- kubernetes \
297
- azure-cli \
298
- google-cloud-sdk \
299
- httpie \
300
- fd-find \
301
- ripgrep \
302
- bat \
303
- exa \
304
- zoxide \
305
- fzf \
306
- delta \
307
- git-delta
308
-
309
- # Create symlinks for tools
310
- ln -sf $(which fdfind) /usr/local/bin/fd
311
- ln -sf $(which batcat) /usr/local/bin/bat
312
- ln -sf $(which exa) /usr/local/bin/ls
313
-
314
- # Install Rust and Cargo
315
- curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
316
- source $HOME/.cargo/env
317
-
318
- # Install additional Rust tools
319
- cargo install \
320
- tokei \
321
- toml-cli \
322
- fd-find \
323
- bat \
324
- exa \
325
- ripgrep-all \
326
- skim \
327
- starship
328
-
329
- # Install Go
330
- wget -qO- https://go.dev/dl/go1.21.5.linux-amd64.tar.gz | tar -C /usr/local -xzf -
331
- echo 'export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin' >> /home/user/.bashrc
332
- export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin
333
-
334
- # Install additional Go tools
335
- go install golang.org/x/tools/cmd/goimports@latest
336
- go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
337
- go install github.com/fzipp/gocyclo/cmd/gocyclo@latest
338
-
339
- # Install Node.js global packages
340
- npm install -g \
341
- eslint \
342
- prettier \
343
- typescript \
344
- ts-node \
345
- nodemon \
346
- pm2 \
347
- http-server \
348
- serve \
349
- create-react-app \
350
- vue-cli \
351
- @angular/cli
352
-
353
- echo "✅ Additional tools installation completed!"
354
- echo "🔧 Available tools: Docker, Kubernetes, Helm, Terraform, AWS CLI, GCP SDK, Azure CLI"
355
- echo "🦀 Rust and Go development environments ready"
356
- echo "📦 Node.js global packages installed"
357
- EOF
358
-
359
- # Make the installation script executable
360
- RUN chmod +x /home/user/workspace/install_tools.sh
361
-
362
- # Create environment information script
363
- RUN cat > /home/user/workspace/environment_info.py << 'EOF'
364
- #!/usr/bin/env python3
365
- """
366
- Environment Information for Ubuntu Sandbox
367
- """
368
-
369
- import os
370
- import sys
371
- import platform
372
- import subprocess
373
- import json
374
- from pathlib import Path
375
- import psutil
376
-
377
- def get_environment_info():
378
- """Get comprehensive environment information"""
379
-
380
- # System information
381
- system_info = {
382
- "platform": platform.platform(),
383
- "system": platform.system(),
384
- "release": platform.release(),
385
- "version": platform.version(),
386
- "machine": platform.machine(),
387
- "processor": platform.processor(),
388
- "python_version": platform.python_version(),
389
- "python_implementation": platform.python_implementation(),
390
- }
391
-
392
- # Hardware information
393
- hardware_info = {
394
- "cpu_count": psutil.cpu_count(),
395
- "cpu_count_logical": psutil.cpu_count(logical=True),
396
- "memory_total": psutil.virtual_memory().total,
397
- "memory_available": psutil.virtual_memory().available,
398
- "disk_usage": psutil.disk_usage('/').total,
399
- "disk_free": psutil.disk_usage('/').free,
400
- }
401
-
402
- # Development environment
403
- dev_info = {
404
- "workspace_path": os.getcwd(),
405
- "python_path": sys.path,
406
- "user": os.getenv("USER", "unknown"),
407
- "home": os.getenv("HOME", "/home/user"),
408
- "current_directory": os.getcwd(),
409
- }
410
-
411
- # Installed tools
412
- tools = {}
413
- common_tools = [
414
- "git", "docker", "python3", "pip3", "node", "npm",
415
- "curl", "wget", "vim", "nano", "jq", "tree", "htop"
416
- ]
417
-
418
- for tool in common_tools:
419
- try:
420
- result = subprocess.run([tool, "--version"], capture_output=True, text=True, timeout=5)
421
- if result.returncode == 0:
422
- version_line = result.stdout.split('\n')[0]
423
- tools[tool] = version_line
424
- else:
425
- tools[tool] = "installed but no version"
426
- except:
427
- tools[tool] = "not found"
428
-
429
- # Docker information
430
- try:
431
- result = subprocess.run(["docker", "--version"], capture_output=True, text=True)
432
- if result.returncode == 0:
433
- tools["docker"] = result.stdout.strip()
434
- except:
435
- tools["docker"] = "not found"
436
-
437
- # Combine all information
438
- env_info = {
439
- "system": system_info,
440
- "hardware": hardware_info,
441
- "development": dev_info,
442
- "tools": tools,
443
- "ai_sandbox": {
444
- "enabled": True,
445
- "build_env": True,
446
- "ship_env": True,
447
- "create_env": True,
448
- "features": [
449
- "Secure sandboxed environment",
450
- "AI model accessible",
451
- "Full Ubuntu command support",
452
- "Development tools pre-installed",
453
- "Web-based interface",
454
- "API endpoints for AI integration"
455
- ]
456
- }
457
- }
458
-
459
- return env_info
460
-
461
- if __name__ == "__main__":
462
- info = get_environment_info()
463
- print(json.dumps(info, indent=2))
464
- EOF
465
-
466
- # Create README and documentation
467
- RUN cat > /home/user/workspace/README.md << 'EOF'
468
- # Ubuntu Sandbox Environment
469
-
470
- A comprehensive, AI-accessible Ubuntu development environment hosted on HuggingFace Spaces.
471
-
472
- ## 🎯 Purpose
473
-
474
- This environment is designed to enable AI models to:
475
- - **Build** applications and software
476
- - **Ship** deployments and containers
477
- - **Create** any type of project
478
- - **Experiment** with new technologies
479
- - **Learn** and develop skills
480
-
481
- ## 🚀 Key Features
482
-
483
- ### For AI Models
484
- - **Web-based interface** with terminal access
485
- - **REST API endpoints** for programmatic access
486
- - **Secure sandboxed** environment
487
- - **Persistent file system** for project work
488
- - **Full Ubuntu command support**
489
- - **Development tools** pre-installed
490
-
491
- ### For Humans
492
- - **Intuitive web interface** for monitoring
493
- - **Real-time terminal interaction**
494
- - **File management system**
495
- - **System monitoring dashboard**
496
- - **Command history tracking**
497
-
498
- ## 🛠️ Pre-installed Tools
499
-
500
- ### Development
501
- - Python 3.x with scientific computing libraries
502
- - Node.js and npm for web development
503
- - Git for version control
504
- - Docker for containerization
505
- - Kubernetes and Helm for orchestration
506
- - Terraform for infrastructure
507
- - AWS, Google Cloud, and Azure CLI tools
508
-
509
- ### System Utilities
510
- - curl, wget, jq, tree, htop
511
- - Text editors: vim, nano
512
- - System monitoring tools
513
- - Network utilities
514
- - Compression tools
515
-
516
- ### Programming Languages
517
- - Python (with pip, setuptools, wheel)
518
- - JavaScript/Node.js
519
- - Go (with goimports, golangci-lint)
520
- - Rust (with Cargo and common crates)
521
- - C/C++ (with build tools)
522
-
523
- ## 🌐 Web Interface
524
-
525
- Access the environment through a web browser at your HuggingFace Space URL.
526
-
527
- ### Features:
528
- - **Terminal Interface**: Execute any Ubuntu command
529
- - **File Manager**: Create, read, and manage files
530
- - **System Monitor**: View resource usage and system info
531
- - **Quick Commands**: One-click access to common operations
532
- - **API Integration**: Perfect for AI model automation
533
 
534
- ## 🤖 AI Model Integration
 
 
535
 
536
- ### API Endpoints
537
-
538
- The environment provides REST API endpoints for AI models:
539
-
540
- 1. **Execute Command**
541
- ```
542
- POST /api/execute
543
- {
544
- "command": "ls -la"
545
- }
546
- ```
547
-
548
- 2. **Create File**
549
- ```
550
- POST /api/create
551
- {
552
- "filename": "test.py",
553
- "content": "print('Hello World!')"
554
- }
555
- ```
556
-
557
- 3. **Read File**
558
- ```
559
- POST /api/read
560
- {
561
- "filename": "test.py"
562
- }
563
- ```
564
-
565
- 4. **List Directory**
566
- ```
567
- POST /api/list
568
- {
569
- "path": "/home/user/workspace"
570
- }
571
- ```
572
-
573
- ### Usage Examples
574
-
575
- #### Python Integration
576
- ```python
577
- import requests
578
-
579
- # Execute command
580
- response = requests.post(
581
- "https://your-space.hf.space/api/execute",
582
- json={"command": "python3 -c 'print(\"Hello from AI!\")'"}
583
- )
584
- print(response.json())
585
-
586
- # Create file
587
- requests.post(
588
- "https://your-space.hf.space/api/create",
589
- json={
590
- "filename": "ai_project.py",
591
- "content": "# AI generated code here"
592
- }
593
- )
594
-
595
- # Read file
596
- response = requests.post(
597
- "https://your-space.hf.space/api/read",
598
- json={"filename": "ai_project.py"}
599
- )
600
- print(response.json()['content'])
601
- ```
602
-
603
- #### JavaScript Integration
604
- ```javascript
605
- // Execute command
606
- fetch('https://your-space.hf.space/api/execute', {
607
- method: 'POST',
608
- headers: {'Content-Type': 'application/json'},
609
- body: JSON.stringify({command: 'ls -la'})
610
- })
611
- .then(response => response.json())
612
- .then(data => console.log(data));
613
-
614
- // Create file
615
- fetch('https://your-space.hf.space/api/create', {
616
- method: 'POST',
617
- headers: {'Content-Type': 'application/json'},
618
- body: JSON.stringify({
619
- filename: 'index.js',
620
- content: 'console.log("Hello from AI!");'
621
- })
622
- })
623
- .then(response => response.json())
624
- .then(data => console.log(data));
625
- ```
626
-
627
- ## 📁 Directory Structure
628
-
629
- ```
630
- /home/user/workspace/
631
- ├── projects/ # Your development projects
632
- ├── data/ # Data files and datasets
633
- ├── temp/ # Temporary files
634
- ├── logs/ # Log files
635
- ├── tools/ # Additional tools and scripts
636
- ├── scripts/ # Utility scripts
637
- ├── install_tools.sh # Additional tool installation
638
- └── environment_info.py # System information script
639
- ```
640
-
641
- ## 🔧 Usage Examples
642
-
643
- ### Basic Commands
644
- ```bash
645
- # Check system info
646
- system_info
647
-
648
- # Install additional tools
649
- ./install_tools.sh
650
-
651
- # Start development
652
- cd projects
653
- python3 --version
654
- node --version
655
- git --version
656
- ```
657
-
658
- ### Development Workflow
659
- ```bash
660
- # Create new project
661
- mkdir my_project
662
- cd my_project
663
- git init
664
- echo "# My Project" > README.md
665
-
666
- # Install dependencies
667
- pip3 install requests numpy pandas
668
- npm init -y
669
- npm install express
670
-
671
- # Start coding
672
- vim main.py
673
- # ... write your code
674
-
675
- # Test and ship
676
- python3 main.py
677
- docker build -t my-app .
678
- ```
679
-
680
- ## 🌟 AI Agent Use Cases
681
-
682
- ### 1. Software Development
683
- - Create applications in any language
684
- - Run tests and debugging
685
- - Package and deploy applications
686
- - Version control and collaboration
687
-
688
- ### 2. Data Science
689
- - Analyze datasets
690
- - Train machine learning models
691
- - Create visualizations
692
- - Generate reports
693
-
694
- ### 3. Web Development
695
- - Build full-stack applications
696
- - Test APIs and services
697
- - Deploy to cloud platforms
698
- - Monitor performance
699
-
700
- ### 4. DevOps Tasks
701
- - Infrastructure as Code
702
- - Container orchestration
703
- - CI/CD pipeline creation
704
- - Monitoring setup
705
-
706
- ### 5. Research and Experimentation
707
- - Academic research projects
708
- - Algorithm development
709
- - Benchmark testing
710
- - Documentation creation
711
-
712
- ## 🔒 Security and Limitations
713
-
714
- ### Security Features
715
- - Isolated container environment
716
- - No root access for security
717
- - Resource limits to prevent abuse
718
- - Session management
719
- - Command logging for monitoring
720
-
721
- ### Limitations
722
- - **Time limits**: Commands timeout after 30 seconds
723
- - **Resource limits**: CPU, memory, and disk quotas
724
- - **Network access**: May be restricted in some spaces
725
- - **Persistence**: Files persist during session but may be cleaned up
726
- - **No system modification**: Cannot modify system-level files
727
-
728
- ## 📞 Support
729
-
730
- This environment is designed to be:
731
- - **Self-documenting**: Use `help` command
732
- - **Error-resistant**: Graceful error handling
733
- - **Resource-aware**: Monitor usage
734
- - **AI-friendly**: Optimized for automated interaction
735
-
736
- ## 🏆 Perfect for AI Models
737
-
738
- This environment enables AI models to:
739
- - Build complete applications
740
- - Ship to production
741
- - Create innovative solutions
742
- - Experiment fearlessly
743
- - Learn from real development work
744
-
745
- **Ready to enable your AI agents to create anything! 🚀**
746
- EOF
747
-
748
- # Copy the main application
749
- COPY app.py /home/user/workspace/
750
- COPY requirements.txt /home/user/workspace/
751
-
752
- # Install Python requirements
753
- RUN pip3 install -r requirements.txt
754
-
755
- # Create startup script
756
- RUN cat > /home/user/workspace/start.sh << 'EOF'
757
- #!/bin/bash
758
- # Startup script for Ubuntu Sandbox Environment
759
-
760
- echo "🚀 Starting Ubuntu Sandbox Environment..."
761
- echo "🔧 Preparing development environment..."
762
-
763
- # Create user workspace if not exists
764
- mkdir -p /home/user/workspace/{projects,data,temp,logs,tools,scripts}
765
-
766
- # Set proper permissions
767
- chmod 755 /home/user/workspace
768
- chmod 755 /home/user/workspace/projects
769
- chmod 755 /home/user/workspace/data
770
- chmod 755 /home/user/workspace/temp
771
-
772
- # Run additional tool installation
773
- if [ "$INSTALL_TOOLS" = "true" ]; then
774
- echo "🛠️ Installing additional development tools..."
775
- /home/user/workspace/install_tools.sh
776
- fi
777
-
778
- # Set up environment variables
779
- export AI_SANDBOX=1
780
- export BUILD_ENV=1
781
- export SHIP_ENV=1
782
- export CREATE_ENV=1
783
- export PYTHONPATH=/home/user/workspace
784
-
785
- echo "✅ Environment ready!"
786
- echo "🎯 AI Models can now build, ship, and create anything!"
787
- echo "🌐 Web interface will be available at the provided URL"
788
-
789
- # Start the application
790
- exec python3 /home/user/workspace/app.py
791
- EOF
792
-
793
- # Make startup script executable
794
- RUN chmod +x /home/user/workspace/start.sh
795
-
796
- # Expose port for Gradio
797
  EXPOSE 7860
798
 
799
- # Health check
800
- HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
801
- CMD curl -f http://localhost:7860/ || exit 1
802
-
803
- # Set environment variables for the app
804
- ENV PYTHONUNBUFFERED=1
805
- ENV GRADIO_SERVER_NAME=0.0.0.0
806
- ENV GRADIO_SERVER_PORT=7860
807
-
808
- # Default command
809
- CMD ["/home/user/workspace/start.sh"]
 
1
+ # Minimal Ubuntu Sandbox - Guaranteed Build
2
+ FROM python:3.11-slim
 
 
 
 
 
 
 
3
 
4
  # Set working directory
5
  WORKDIR /home/user/workspace
6
 
7
+ # Install system dependencies
8
+ RUN apt-get update && apt-get install -y \
 
 
 
 
 
 
9
  git \
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10
  curl \
11
  wget \
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
12
  && rm -rf /var/lib/apt/lists/*
13
 
14
+ # Install Python dependencies
15
+ COPY requirements_minimal.txt /tmp/requirements.txt
16
+ RUN pip install --no-cache-dir -r /tmp/requirements.txt
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
17
 
18
+ # Copy application
19
+ COPY app.py /home/user/workspace/app.py
20
+ COPY config.yaml /home/user/workspace/config.yaml
21
 
22
+ # Expose port
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
23
  EXPOSE 7860
24
 
25
+ # Run the application
26
+ CMD ["python", "/home/user/workspace/app.py"]