chipling commited on
Commit
d28a325
·
verified ·
1 Parent(s): 32067fa

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +40 -0
Dockerfile ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Use a base Ubuntu image with Python
2
+ FROM python:3.9-slim-buster
3
+
4
+ # 1. Install system dependencies (XFCE Desktop, VNC, Audio tools)
5
+ # We suppress prompts to avoid build errors
6
+ ENV DEBIAN_FRONTEND=noninteractive
7
+ RUN apt-get update && apt-get install -y \
8
+ xfce4 \
9
+ xfce4-terminal \
10
+ xvfb \
11
+ x11vnc \
12
+ novnc \
13
+ python3-websockify \
14
+ python3-numpy \
15
+ firefox-esr \
16
+ sudo \
17
+ curl \
18
+ git \
19
+ vim \
20
+ && rm -rf /var/lib/apt/lists/*
21
+
22
+ # 2. Setup a non-root user (Hugging Face Spaces defaults to UID 1000)
23
+ RUN useradd -m -u 1000 user
24
+ RUN echo "user ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
25
+
26
+ # 3. Set up the working directory
27
+ USER user
28
+ ENV HOME=/home/user \
29
+ PATH=/home/user/.local/bin:$PATH
30
+ WORKDIR $HOME
31
+
32
+ # 4. Create the start script
33
+ COPY --chown=user start.sh start.sh
34
+ RUN chmod +x start.sh
35
+
36
+ # 5. Expose the Hugging Face port
37
+ EXPOSE 7860
38
+
39
+ # 6. Run the start script
40
+ CMD ["./start.sh"]