Fred808 commited on
Commit
6a617f0
·
verified ·
1 Parent(s): fd70fb2

Upload Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +45 -0
Dockerfile ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # QEMU Web Interface Dockerfile with Unlimited Storage
2
+ FROM python:3.12-slim
3
+
4
+ # Install system dependencies with unlimited storage configuration
5
+ RUN apt-get update && \
6
+ apt-get install -y qemu-system-x86 qemu-utils libvirt-daemon-system libvirt-clients git curl && \
7
+ apt-get clean && rm -rf /var/lib/apt/lists/*
8
+
9
+ # Set workdir
10
+ WORKDIR /app
11
+
12
+ # Copy application code
13
+ COPY . /app
14
+
15
+ # Install Python dependencies including HuggingFace datasets
16
+ RUN pip install --no-cache-dir -r requirements.txt && \
17
+ pip install --no-cache-dir datasets huggingface_hub
18
+
19
+ # Configure unlimited storage settings
20
+ ENV STORAGE_LIMIT=unlimited
21
+ ENV GPU_MEMORY_LIMIT=unlimited
22
+ ENV CPU_MEMORY_LIMIT=unlimited
23
+ ENV DISK_SPACE_LIMIT=unlimited
24
+ ENV HF_DATASETS_CACHE=/tmp/hf_cache
25
+
26
+ # Make the entire /app directory fully writeable for all users
27
+ RUN chmod -R 777 /app
28
+
29
+ # Create unlimited storage directories
30
+ RUN mkdir -p /tmp/hf_cache && chmod -R 777 /tmp/hf_cache
31
+
32
+ # Ensure the app runs as the same user as the Space UI
33
+ RUN useradd -m -u 1000 user
34
+ USER user
35
+
36
+ # Set environment variables for unlimited resources
37
+ ENV PYTHONUNBUFFERED=1
38
+ ENV HF_HOME=/tmp/hf_cache
39
+ ENV TRANSFORMERS_CACHE=/tmp/hf_cache
40
+
41
+ # Expose web interface port (adjust as needed)
42
+ EXPOSE 8080
43
+
44
+ # Default command to run the QEMU web interface
45
+ CMD ["python", "qemu/web_interface.py"]