Update Dockerfile
Browse files- Dockerfile +30 -36
Dockerfile
CHANGED
|
@@ -1,44 +1,38 @@
|
|
| 1 |
FROM ubuntu:22.04
|
| 2 |
|
| 3 |
ENV DEBIAN_FRONTEND=noninteractive
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
curl \
|
| 11 |
-
|
| 12 |
-
ca-certificates \
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
&& echo "Etc/UTC" > /etc/timezone \
|
| 18 |
-
&& dpkg-reconfigure -f noninteractive tzdata \
|
| 19 |
-
&& rm -rf /var/lib/apt/lists/*
|
| 20 |
-
|
| 21 |
-
# Create user
|
| 22 |
-
RUN useradd -m -s /bin/bash user && \
|
| 23 |
-
echo 'user:yourpassword' | chpasswd && \
|
| 24 |
-
echo 'user ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
|
| 25 |
-
RUN mkdir -p /var/run/tailscale
|
| 26 |
-
# Install Tailscale
|
| 27 |
-
RUN curl -fsSL https://tailscale.com/install.sh | sh
|
| 28 |
-
|
| 29 |
-
# Install Python dependencies
|
| 30 |
-
RUN pip3 install flask gunicorn
|
| 31 |
-
|
| 32 |
-
# Set working directory
|
| 33 |
-
WORKDIR /app
|
| 34 |
|
| 35 |
-
#
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 39 |
|
| 40 |
-
# Expose Flask port
|
| 41 |
EXPOSE 7860
|
| 42 |
|
| 43 |
-
#
|
| 44 |
-
CMD
|
|
|
|
| 1 |
FROM ubuntu:22.04
|
| 2 |
|
| 3 |
ENV DEBIAN_FRONTEND=noninteractive
|
| 4 |
+
ENV R3_REGISTRATION_CODE="7D3A85E9-0DDA-503C-B521-052F1F15D160"
|
| 5 |
+
|
| 6 |
+
# Update and upgrade using both apt and apt-get
|
| 7 |
+
RUN apt update && apt upgrade -y && \
|
| 8 |
+
apt-get update && apt-get upgrade -y && \
|
| 9 |
+
apt-get install -y \
|
| 10 |
+
python3 python3-pip \
|
| 11 |
+
nodejs npm \
|
| 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 (if needed)
|
| 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 |
+
# Install remote.it agent using the registration code environment variable
|
| 29 |
+
RUN sh -c "$(curl -L https://downloads.remote.it/remoteit/install_agent.sh)"
|
| 30 |
+
|
| 31 |
+
# Dummy file to keep container alive
|
| 32 |
+
RUN mkdir -p /app && echo "Remote.it Agent Running..." > /app/index.html
|
| 33 |
+
WORKDIR /app
|
| 34 |
|
|
|
|
| 35 |
EXPOSE 7860
|
| 36 |
|
| 37 |
+
# Start dummy HTTP server and remote.it agent
|
| 38 |
+
CMD python3 -m http.server 7860 & remoteit agent start
|