userrein commited on
Commit
afcae6b
·
verified ·
1 Parent(s): 0d68f69

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +30 -0
Dockerfile ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM ubuntu:22.04
2
+
3
+ ENV DEBIAN_FRONTEND=noninteractive
4
+
5
+ RUN apt-get update && apt-get install -y \
6
+ openssh-server curl wget unzip python3 \
7
+ && rm -rf /var/lib/apt/lists/*
8
+
9
+ # setup ssh
10
+ RUN mkdir /var/run/sshd
11
+ RUN echo "root:123456" | chpasswd
12
+ RUN sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config
13
+ RUN sed -i 's/#PasswordAuthentication yes/PasswordAuthentication yes/' /etc/ssh/sshd_config
14
+
15
+ # install ngrok
16
+ RUN curl -L https://bin.equinox.io/c/bNyj1mQVY4c/ngrok-v3-stable-linux-amd64.zip -o ngrok.zip \
17
+ && unzip ngrok.zip \
18
+ && mv ngrok /usr/local/bin/ngrok
19
+
20
+ # GANTI TOKEN KAMU
21
+ RUN ngrok config add-authtoken 3BUzxPBLKCbyYCQluIjmxYZCNKP_81Vwt3PwtJQMuegkJCUe
22
+
23
+ EXPOSE 7860
24
+
25
+ CMD python3 -m http.server 7860
26
+ echo 'SSH RUNNING' && \
27
+ python3 -m http.server 7860 & \
28
+ /usr/sbin/sshd & \
29
+ sleep 5 && ngrok tcp 22 && \
30
+ tail -f /dev/null"