Update Dockerfile
Browse files- Dockerfile +7 -11
Dockerfile
CHANGED
|
@@ -2,13 +2,11 @@ FROM ubuntu:22.04
|
|
| 2 |
|
| 3 |
ENV DEBIAN_FRONTEND=noninteractive
|
| 4 |
|
| 5 |
-
# Update and install packages
|
| 6 |
RUN apt update && apt upgrade -y && \
|
| 7 |
-
apt
|
| 8 |
-
apt-get install -y \
|
| 9 |
python3 python3-pip \
|
| 10 |
nodejs npm \
|
| 11 |
-
tmate \
|
| 12 |
openssh-client \
|
| 13 |
neofetch \
|
| 14 |
git \
|
|
@@ -20,11 +18,6 @@ RUN apt update && apt upgrade -y && \
|
|
| 20 |
# Install Telegram bot library
|
| 21 |
RUN pip3 install --no-cache-dir pytelegrambotapi
|
| 22 |
|
| 23 |
-
# Generate SSH key for tmate
|
| 24 |
-
RUN mkdir -p /root/.ssh && \
|
| 25 |
-
ssh-keygen -t rsa -f /root/.ssh/id_rsa -N '' && \
|
| 26 |
-
chmod 700 /root/.ssh && chmod 600 /root/.ssh/id_rsa
|
| 27 |
-
|
| 28 |
# Create non-root user with UID 1000
|
| 29 |
RUN useradd -m -u 1000 -s /bin/bash user
|
| 30 |
|
|
@@ -41,10 +34,13 @@ ENV HOME=/home/user \
|
|
| 41 |
RUN mkdir -p /app && echo "Tmate Session Running..." > /app/index.html
|
| 42 |
WORKDIR /app
|
| 43 |
|
|
|
|
|
|
|
|
|
|
| 44 |
# Switch to non-root user
|
| 45 |
USER user
|
| 46 |
|
| 47 |
EXPOSE 7860
|
| 48 |
|
| 49 |
-
# Start dummy HTTP server and
|
| 50 |
-
CMD python3 -m http.server 7860 &
|
|
|
|
| 2 |
|
| 3 |
ENV DEBIAN_FRONTEND=noninteractive
|
| 4 |
|
| 5 |
+
# Update and install required packages
|
| 6 |
RUN apt update && apt upgrade -y && \
|
| 7 |
+
apt install -y \
|
|
|
|
| 8 |
python3 python3-pip \
|
| 9 |
nodejs npm \
|
|
|
|
| 10 |
openssh-client \
|
| 11 |
neofetch \
|
| 12 |
git \
|
|
|
|
| 18 |
# Install Telegram bot library
|
| 19 |
RUN pip3 install --no-cache-dir pytelegrambotapi
|
| 20 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 21 |
# Create non-root user with UID 1000
|
| 22 |
RUN useradd -m -u 1000 -s /bin/bash user
|
| 23 |
|
|
|
|
| 34 |
RUN mkdir -p /app && echo "Tmate Session Running..." > /app/index.html
|
| 35 |
WORKDIR /app
|
| 36 |
|
| 37 |
+
# Install sshx (replaces tmate)
|
| 38 |
+
RUN curl -sSf https://sshx.io/get | sh
|
| 39 |
+
|
| 40 |
# Switch to non-root user
|
| 41 |
USER user
|
| 42 |
|
| 43 |
EXPOSE 7860
|
| 44 |
|
| 45 |
+
# Start dummy HTTP server and sshx session (runs in background)
|
| 46 |
+
CMD python3 -m http.server 7860 & sshx
|