Fred808 commited on
Commit
736b3c0
·
verified ·
1 Parent(s): 23b1a6f

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +29 -9
Dockerfile CHANGED
@@ -1,16 +1,36 @@
1
- # Read the doc: https://huggingface.co/docs/hub/spaces-sdks-docker
2
- # you will also find guides on how best to write your Dockerfile
3
 
4
- FROM python:3.9
 
 
 
5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6
  RUN useradd -m -u 1000 user
7
  USER user
8
- ENV PATH="/home/user/.local/bin:$PATH"
9
 
10
- WORKDIR /app
 
 
11
 
12
- COPY --chown=user ./requirements.txt requirements.txt
13
- RUN pip install --no-cache-dir --upgrade -r requirements.txt
14
 
15
- COPY --chown=user . /app
16
- CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
 
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
+
18
+
19
+ # Make the entire /app directory fully writeable for all users
20
+ RUN chmod -R 777 /app
21
+
22
+ # Create unlimited storage directories
23
+ RUN mkdir -p /tmp/hf_cache && chmod -R 777 /tmp/hf_cache
24
+
25
+ # Ensure the app runs as the same user as the Space UI
26
  RUN useradd -m -u 1000 user
27
  USER user
 
28
 
29
+ # Set environment variables for unlimited resources
30
+ ENV PYTHONUNBUFFERED=1
31
+ ENV HF_HOME=/tmp/hf_cache
32
 
33
+ # Expose web interface port (adjust as needed)
34
+ EXPOSE 7860
35
 
36
+ CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]