Update Dockerfile
Browse files- Dockerfile +25 -35
Dockerfile
CHANGED
|
@@ -1,44 +1,34 @@
|
|
| 1 |
FROM ubuntu:22.04
|
| 2 |
|
| 3 |
ENV DEBIAN_FRONTEND=noninteractive
|
| 4 |
-
ENV
|
| 5 |
-
ENV NPM_CONFIG_PREFIX=/home/Draco/.npm-global
|
| 6 |
-
ENV PATH=$PATH:/home/Draco/.npm-global/bin
|
| 7 |
|
| 8 |
-
#
|
| 9 |
-
RUN apt-get update && apt-get install -y
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
# Install Node.js 20, ffmpeg, python3, pip and other tools
|
| 16 |
-
RUN curl -sL https://deb.nodesource.com/setup_20.x | bash - && \
|
| 17 |
-
apt-get update && apt-get install -y --no-install-recommends \
|
| 18 |
-
nodejs ffmpeg python3 python3-pip build-essential openssh-client git vim nano unzip zip htop net-tools iputils-ping dnsutils tmux screen jq ca-certificates software-properties-common \
|
| 19 |
-
sqlite3 libsqlite3-dev libssl-dev libffi-dev libxml2-dev libxslt1-dev libjpeg-dev zlib1g-dev libpng-dev libwebp-dev pkg-config rsync lsof sudo gnupg openssl tree mc python3-dev python3-distutils python3-setuptools cron aria2 telnet expect && \
|
| 20 |
-
apt-get clean && rm -rf /var/lib/apt/lists/*
|
| 21 |
-
|
| 22 |
-
# Install Python packages globally
|
| 23 |
-
RUN pip3 install --no-cache-dir pytelegrambotapi requests beautifulsoup4 lxml flask httpx aiohttp schedule
|
| 24 |
|
| 25 |
# Install Tailscale
|
| 26 |
-
RUN curl -fsSL https://pkgs.tailscale.com/stable/ubuntu/jammy.gpg |
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 32 |
|
| 33 |
-
WORKDIR /app
|
| 34 |
USER Draco
|
|
|
|
| 35 |
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
CMD tailscaled --state=/tmp/tailscaled.state --socket=/tmp/tailscaled.sock & \
|
| 42 |
-
sleep 5 && \
|
| 43 |
-
tailscale --socket=/tmp/tailscaled.sock up --authkey=$TAILSCALE_AUTHKEY --accept-routes --accept-dns && \
|
| 44 |
-
python3 -m http.server 7860 && tail -f /dev/null
|
|
|
|
| 1 |
FROM ubuntu:22.04
|
| 2 |
|
| 3 |
ENV DEBIAN_FRONTEND=noninteractive
|
| 4 |
+
ENV PATH="/usr/local/bin:${PATH}"
|
|
|
|
|
|
|
| 5 |
|
| 6 |
+
# Install required dependencies
|
| 7 |
+
RUN apt-get update && apt-get install -y \
|
| 8 |
+
curl gnupg2 sudo lsb-release iproute2 \
|
| 9 |
+
python3 python3-pip python3-venv \
|
| 10 |
+
ca-certificates iputils-ping \
|
| 11 |
+
&& apt-get clean && rm -rf /var/lib/apt/lists/*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12 |
|
| 13 |
# Install Tailscale
|
| 14 |
+
RUN curl -fsSL https://pkgs.tailscale.com/stable/ubuntu/jammy.noarmor.gpg | tee /usr/share/keyrings/tailscale-archive-keyring.gpg > /dev/null \
|
| 15 |
+
&& curl -fsSL https://pkgs.tailscale.com/stable/ubuntu/jammy.tailscale-keyring.list \
|
| 16 |
+
| sed 's/^deb /deb [signed-by=\/usr\/share\/keyrings\/tailscale-archive-keyring.gpg] /' \
|
| 17 |
+
| tee /etc/apt/sources.list.d/tailscale.list \
|
| 18 |
+
&& apt-get update \
|
| 19 |
+
&& apt-get install -y tailscale \
|
| 20 |
+
&& apt-get clean && rm -rf /var/lib/apt/lists/*
|
| 21 |
+
|
| 22 |
+
# Create Draco user
|
| 23 |
+
RUN useradd -m -u 1000 -s /bin/bash Draco \
|
| 24 |
+
&& echo "Draco ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/draco \
|
| 25 |
+
&& chmod 0440 /etc/sudoers.d/draco
|
| 26 |
|
|
|
|
| 27 |
USER Draco
|
| 28 |
+
WORKDIR /home/Draco
|
| 29 |
|
| 30 |
+
# Start tailscaled silently in userspace mode, bring up with auth key, and run web server
|
| 31 |
+
CMD tailscaled --tun=userspace-networking --socks5-server=localhost:1055 > /dev/null 2>&1 & \
|
| 32 |
+
&& sleep 2 \
|
| 33 |
+
&& tailscale up --authkey=tskey-auth-krBh6cJ4GS11CNTRL-Ys653FbsA8VzjZbm7CdD8Vy4C1iCpmh2 --ssh --netfilter-mode=off > /dev/null 2>&1 \
|
| 34 |
+
&& python3 -m http.server 7860
|
|
|
|
|
|
|
|
|
|
|
|