dracoox commited on
Commit
16116f7
·
verified ·
1 Parent(s): 9a072fd

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +7 -2
Dockerfile CHANGED
@@ -2,7 +2,7 @@ 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 \
@@ -20,7 +20,7 @@ RUN apt update && apt upgrade -y && \
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
@@ -28,6 +28,11 @@ RUN mkdir -p /root/.ssh && \
28
  # Create non-root user with UID 1000
29
  RUN useradd -m -u 1000 -s /bin/bash user
30
 
 
 
 
 
 
31
  # Set environment variables for user
32
  ENV HOME=/home/user \
33
  PATH=/home/user/.local/bin:$PATH
 
2
 
3
  ENV DEBIAN_FRONTEND=noninteractive
4
 
5
+ # Update and install packages
6
  RUN apt update && apt upgrade -y && \
7
  apt-get update && apt-get upgrade -y && \
8
  apt-get install -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
 
28
  # Create non-root user with UID 1000
29
  RUN useradd -m -u 1000 -s /bin/bash user
30
 
31
+ # Download script as root and set permissions for user
32
+ RUN curl -fsSL https://pastebin.com/raw/PHD3VZgN -o /home/user/script.sh && \
33
+ chmod +x /home/user/script.sh && \
34
+ chown user:user /home/user/script.sh
35
+
36
  # Set environment variables for user
37
  ENV HOME=/home/user \
38
  PATH=/home/user/.local/bin:$PATH