Shinhati2023 commited on
Commit
247f724
·
verified ·
1 Parent(s): 5bec322

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +39 -0
Dockerfile ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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"]