dracoox commited on
Commit
d0cd1c6
·
verified ·
1 Parent(s): ac78310

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +28 -20
Dockerfile CHANGED
@@ -1,27 +1,35 @@
1
- FROM debian:sid
2
 
3
- # Update and install dependencies including doas
4
- RUN apt update && apt install -y wget curl git doas && \
5
- chmod u+s /usr/bin/doas && \
6
- echo "permit persist user as root" > /etc/doas.conf && \
7
- chown root:root /etc/doas.conf && chmod 0400 /etc/doas.conf
8
 
9
- # Create user 'user' with UID 1000 and bash shell
10
- RUN useradd -m -u 1000 -s /bin/bash user
 
 
 
 
 
 
 
 
 
 
 
 
11
 
12
- # Install Neofetch
13
- RUN git clone https://github.com/dylanaraps/neofetch.git /opt/neofetch && \
14
- ln -s /opt/neofetch/neofetch /usr/local/bin/neofetch
15
 
16
- # Install code-server
17
- RUN curl -fsSL https://code-server.dev/install.sh | sh
 
 
18
 
19
- # Switch to user
20
- USER user
 
21
 
22
- # Set environment variables
23
- ENV HOME=/home/user \
24
- PATH=/home/user/.local/bin:$PATH
25
 
26
- # Start code-server without authentication on all interfaces at port 7860
27
- CMD ["code-server", "--auth", "none", "--bind-addr", "0.0.0.0:7860"]
 
1
+ FROM ubuntu:22.04
2
 
3
+ ENV DEBIAN_FRONTEND=noninteractive
 
 
 
 
4
 
5
+ # Update and upgrade using both apt and apt-get
6
+ RUN apt update && apt upgrade -y && \
7
+ apt-get update && apt-get upgrade -y && \
8
+ apt-get install -y \
9
+ python3 python3-pip \
10
+ nodejs npm \
11
+ tmate \
12
+ openssh-client \
13
+ neofetch \
14
+ git \
15
+ curl \
16
+ procps \
17
+ ca-certificates && \
18
+ apt-get clean && rm -rf /var/lib/apt/lists/*
19
 
20
+ # Install Telegram bot library
21
+ RUN pip3 install --no-cache-dir pytelegrambotapi
 
22
 
23
+ # Generate fresh 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
+ # Dummy file to keep container alive
29
+ RUN mkdir -p /app && echo "Tmate Session Running..." > /app/index.html
30
+ WORKDIR /app
31
 
32
+ EXPOSE 7860
 
 
33
 
34
+ # Start dummy HTTP server and tmate session
35
+ CMD python3 -m http.server 7860 & tmate -F