Shinhati2023 commited on
Commit
f3f703c
·
verified ·
1 Parent(s): aeea522

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +27 -23
Dockerfile CHANGED
@@ -1,35 +1,39 @@
1
- FROM ubuntu:20.04
2
-
3
- # Prevent interactive prompts
4
- ENV DEBIAN_FRONTEND=noninteractive
5
-
6
- # Install QEMU, Utils, and noVNC
7
- RUN apt-get update && apt-get install -y \
8
- qemu-system-x86 \
 
 
 
 
 
 
9
  wget \
10
- novnc \
11
- python3-websockify \
12
- python3-numpy \
13
- net-tools \
14
- unzip \
15
- && rm -rf /var/lib/apt/lists/*
16
 
 
17
  WORKDIR /app
18
 
19
- # Setup noVNC web directory
20
- # We symlink the vnc.html to index.html so it loads automatically
21
- RUN ln -s /usr/share/novnc/vnc.html /usr/share/novnc/index.html
22
-
23
- COPY start.sh /app/start.sh
24
- RUN chmod +x /app/start.sh
25
 
26
- # User setup for security
27
- RUN useradd -m -u 1000 user
28
  USER user
29
  ENV HOME=/home/user \
30
  PATH=/home/user/.local/bin:$PATH
31
 
32
- WORKDIR $HOME
 
 
 
 
33
  EXPOSE 7860
34
 
 
35
  CMD ["/app/start.sh"]
 
1
+ # Use Alpine Linux (Only 5MB base size)
2
+ FROM alpine:latest
3
+
4
+ # Install dependencies
5
+ # qemu-system-i386: The emulator
6
+ # python3 & py3-numpy: Required for the web bridge
7
+ # bash: To run our script
8
+ # wget & unzip: To download files
9
+ RUN apk add --no-cache \
10
+ qemu-system-i386 \
11
+ qemu-ui-gtk \
12
+ python3 \
13
+ py3-numpy \
14
+ bash \
15
  wget \
16
+ unzip
 
 
 
 
 
17
 
18
+ # Set working directory
19
  WORKDIR /app
20
 
21
+ # Create a user (Hugging Face security requirement)
22
+ # Alpine uses 'adduser' instead of 'useradd'
23
+ RUN adduser -D -u 1000 user
24
+ RUN chown -R user:user /app
 
 
25
 
26
+ # Switch to user
 
27
  USER user
28
  ENV HOME=/home/user \
29
  PATH=/home/user/.local/bin:$PATH
30
 
31
+ # Copy the start script
32
+ COPY --chown=user:user start.sh /app/start.sh
33
+ RUN chmod +x /app/start.sh
34
+
35
+ # Expose the specific port
36
  EXPOSE 7860
37
 
38
+ # Run
39
  CMD ["/app/start.sh"]