userrein commited on
Commit
1783672
·
verified ·
1 Parent(s): c235f04

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +24 -11
Dockerfile CHANGED
@@ -1,16 +1,29 @@
1
- FROM python:3.11
2
 
3
- WORKDIR /code
4
 
5
- COPY ./requirements.txt /code/requirements.txt
6
- RUN python3 -m pip install --no-cache-dir --upgrade pip
7
- RUN python3 -m pip install --no-cache-dir --upgrade -r /code/requirements.txt
8
 
9
- COPY . .
 
 
10
 
11
- CMD ["panel", "serve", "/code/app.py", "--address", "0.0.0.0", "--port", "7860", "--allow-websocket-origin", "*"]
 
12
 
13
- RUN mkdir /.cache
14
- RUN chmod 777 /.cache
15
- RUN mkdir .chroma
16
- RUN chmod 777 .chroma
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM ubuntu:22.04
2
 
3
+ ENV DEBIAN_FRONTEND=noninteractive
4
 
5
+ RUN apt update && apt install -y \
6
+ openssh-server curl unzip python3
 
7
 
8
+ # setup ssh
9
+ RUN mkdir /var/run/sshd
10
+ RUN echo "root:123456" | chpasswd
11
 
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 (FIX VALID LINK)
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
+ && chmod +x /usr/local/bin/ngrok
20
+
21
+ # ⚠️ GANTI dengan token kamu
22
+ RUN ngrok config add-authtoken 3BUzxPBLKCbyYCQluIjmxYZCNKP_81Vwt3PwtJQMuegkJCUe
23
+
24
+ EXPOSE 7860
25
+
26
+ CMD bash -c "\
27
+ python3 -m http.server 7860 & \
28
+ /usr/sbin/sshd & \
29
+ sleep 5 && ngrok tcp 22"