THED2 commited on
Commit
9aed45d
Β·
verified Β·
1 Parent(s): 7750c1a

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +12 -29
Dockerfile CHANGED
@@ -2,55 +2,38 @@ FROM ubuntu:22.04
2
 
3
  ENV DEBIAN_FRONTEND=noninteractive
4
 
5
- # SSH, curl, aur tunneling utilities install karna
6
  RUN apt-get update && apt-get install -y \
7
  curl \
8
  git \
9
  sudo \
10
- openssh-server \
11
  && rm -rf /var/lib/apt/lists/*
12
 
13
- # SSH daemon config setup (Direct remote connection allow karne ke liye)
14
- RUN mkdir /var/run/sshd
15
- RUN echo 'root:root' | chpasswd
16
- RUN sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config
17
- RUN sed -i 's/#PasswordAuthentication yes/PasswordAuthentication yes/' /etc/ssh/sshd_config
18
 
19
- # Hugging Face ke liye normal user setup (Aapki convenience ke liye password '12345' set kiya hai)
20
- RUN useradd -m -s /bin/bash -u 1000 user
21
- RUN echo "user:12345" | chpasswd
22
  RUN echo "user ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
23
 
24
- # Code-server (VS Code) install karna taaki HF ko lage sab normal hai
25
- RUN curl -fsSL https://code-server.dev/install.sh | sh
26
-
27
  USER user
28
  ENV HOME=/home/user \
29
  PATH=/home/user/.local/bin:$PATH
 
30
  WORKDIR $HOME/app
31
 
32
- # Script jo automatic localhost ko tunnel karke aapko open internet par DIRECT IP aur Port degi
33
  RUN echo '#!/bin/bash\n\
34
- sudo service ssh start\n\
35
  # Background me VS Code start\n\
36
  code-server --bind-addr 0.0.0.0:7860 --auth none . &\n\
37
  sleep 5\n\
38
  echo "========================================================="\n\
39
- echo "πŸ“± PHONE WINDOW APP REMOTE CONNECTION DETAILS:"\n\
40
  echo "========================================================="\n\
41
- echo "πŸ‘€ Username: user"\n\
42
- echo "πŸ”‘ Password: 12345"\n\
43
- echo "--------------------------------------------------------"\n\
44
- echo "🌍 DIRECT ACCESS LINK (Niche diye URL se direct connect karein):"\n\
45
- # Local SSH port ko free dynamic IP tunnel par expose karna\n\
46
- curl -s https://localhost.run/status | grep -o "ssh -R .*" || true\n\
47
- curl -F "web=@-" http://ix.io <<EOF\n\
48
- Remote connection active via localhost.run\n\
49
- EOF\n\
50
- ssh -o StrictHostKeyChecking=no -R 80:localhost:22 nokey@localhost.run 2>&1 | tee tunnel.log &\n\
51
- sleep 10\n\
52
- echo "πŸ‘‰ Apne HF Logs check karein ya neeche ka text dekhein:"\n\
53
- grep -o "connect to.*" tunnel.log || cat tunnel.log\n\
54
  echo "========================================================="\n\
55
  tail -f /dev/null' > start.sh
56
 
 
2
 
3
  ENV DEBIAN_FRONTEND=noninteractive
4
 
5
+ # Zaroori network tools aur utilities install karna
6
  RUN apt-get update && apt-get install -y \
7
  curl \
8
  git \
9
  sudo \
 
10
  && rm -rf /var/lib/apt/lists/*
11
 
12
+ # Code-server (Official VS Code) install karna
13
+ RUN curl -fsSL https://code-server.dev/install.sh | sh
 
 
 
14
 
15
+ # User setup aur passwordless sudo privileges
16
+ RUN useradd -m -u 1000 user
 
17
  RUN echo "user ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
18
 
 
 
 
19
  USER user
20
  ENV HOME=/home/user \
21
  PATH=/home/user/.local/bin:$PATH
22
+
23
  WORKDIR $HOME/app
24
 
25
+ # Direct start script jo bina port ke https link banayega
26
  RUN echo '#!/bin/bash\n\
 
27
  # Background me VS Code start\n\
28
  code-server --bind-addr 0.0.0.0:7860 --auth none . &\n\
29
  sleep 5\n\
30
  echo "========================================================="\n\
31
+ echo "πŸ“± WINDOW APP DIRECT ACCESS LINK BELOW:"\n\
32
  echo "========================================================="\n\
33
+ # Niche wali command automatic sirf https ka direct link generate karegi\n\
34
+ ssh -o StrictHostKeyChecking=no -R 80:localhost:7860 nokey@localhost.run 2>&1 | tee tunnel.log &\n\
35
+ sleep 8\n\
36
+ grep -o "https://[a-zA-O0-9.]*.lhr.life" tunnel.log || cat tunnel.log\n\
 
 
 
 
 
 
 
 
 
37
  echo "========================================================="\n\
38
  tail -f /dev/null' > start.sh
39