THED1 commited on
Commit
3b2d6e8
·
verified ·
1 Parent(s): e3d2ea6

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +45 -0
Dockerfile ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Ubuntu base image ka use kar rahe hain
2
+ FROM ubuntu:22.04
3
+
4
+ # Interactive prompts ko disable karne ke liye
5
+ ENV DEBIAN_FRONTEND=noninteractive
6
+
7
+ # System packages install karna (LXDE, XRDP, aur baaki zaroori tools)
8
+ RUN apt-get update && apt-get install -y \
9
+ lxde \
10
+ xrdp \
11
+ xterm \
12
+ sudo \
13
+ curl \
14
+ wget \
15
+ git \
16
+ &> /dev/null && rm -rf /var/lib/apt/lists/*
17
+
18
+ # Ek naya user create kar rahe hain kyunki Hugging Face root user allow nahi karta
19
+ RUN useradd -m -s /bin/bash hfuser && \
20
+ echo "hfuser:password123" | chpasswd && \
21
+ adduser hfuser sudo
22
+
23
+ # XRDP ko configure karna taaki wo root ke bina chal sake
24
+ RUN sed -i 's/3389/7860/g' /etc/xrdp/xrdp.ini && \
25
+ sed -i 's/xrdp1/hfuser/g' /etc/xrdp/xrdp.ini && \
26
+ mkdir -p /var/run/xrdp /var/log/xrdp && \
27
+ chmod -R 777 /var/run/xrdp /var/log/xrdp /etc/xrdp
28
+
29
+ # User switch karna
30
+ USER hfuser
31
+ WORKDIR /home/hfuser
32
+
33
+ # Xsession setup karna desktop environment ke liye
34
+ RUN echo "startlxde" > /home/hfuser/.xsession && \
35
+ chmod +x /home/hfuser/.xsession
36
+
37
+ # Startup script ko copy aur configure karna
38
+ COPY --chown=hfuser:hfuser start.sh /home/hfuser/start.sh
39
+ RUN chmod +x /home/hfuser/start.sh
40
+
41
+ # Hugging Face default port 7860 use karta hai
42
+ EXPOSE 7860
43
+
44
+ # Container start hone par ye script chalegi
45
+ CMD ["./start.sh"]