Spaces:
Paused
Paused
Update Dockerfile
Browse files- Dockerfile +49 -8
Dockerfile
CHANGED
|
@@ -1,12 +1,53 @@
|
|
| 1 |
-
FROM
|
| 2 |
|
| 3 |
-
|
| 4 |
-
RUN rm /etc/nginx/conf.d/default.conf
|
| 5 |
|
| 6 |
-
|
| 7 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
|
| 9 |
-
|
| 10 |
-
EXPOSE 7860
|
| 11 |
|
| 12 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
FROM debian:12-slim
|
| 2 |
|
| 3 |
+
ENV DEBIAN_FRONTEND=noninteractive
|
|
|
|
| 4 |
|
| 5 |
+
RUN apt-get update && apt-get install -y \
|
| 6 |
+
openssh-server \
|
| 7 |
+
curl \
|
| 8 |
+
wget \
|
| 9 |
+
sudo \
|
| 10 |
+
iproute2 \
|
| 11 |
+
iptables \
|
| 12 |
+
ca-certificates \
|
| 13 |
+
procps \
|
| 14 |
+
net-tools \
|
| 15 |
+
vim \
|
| 16 |
+
nano \
|
| 17 |
+
htop \
|
| 18 |
+
git \
|
| 19 |
+
unzip \
|
| 20 |
+
gnupg \
|
| 21 |
+
lsb-release \
|
| 22 |
+
&& rm -rf /var/lib/apt/lists/*
|
| 23 |
|
| 24 |
+
RUN curl -fsSL https://tailscale.com/install.sh | sh
|
|
|
|
| 25 |
|
| 26 |
+
RUN mkdir -p /run/sshd /var/run/tailscale /var/lib/tailscale /var/cache/tailscale
|
| 27 |
+
|
| 28 |
+
RUN echo 'root:root' | chpasswd
|
| 29 |
+
|
| 30 |
+
RUN sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config && \
|
| 31 |
+
sed -i 's/#PasswordAuthentication yes/PasswordAuthentication yes/' /etc/ssh/sshd_config && \
|
| 32 |
+
sed -i 's/PasswordAuthentication no/PasswordAuthentication yes/' /etc/ssh/sshd_config
|
| 33 |
+
|
| 34 |
+
RUN printf '#!/bin/bash\n\
|
| 35 |
+
set -e\n\
|
| 36 |
+
AUTH_KEY="${TAILSCALE_AUTH_KEY:-tskey-auth-kH3iQLsz2M11CNTRL-W2XXWuwXahQfCgo8GQBFhQJMVj4GRUJaj}"\n\
|
| 37 |
+
HOSTNAME="${CONTAINER_HOSTNAME:-vps-container}"\n\
|
| 38 |
+
/usr/sbin/sshd\n\
|
| 39 |
+
tailscaled --tun=userspace-networking --statedir=/var/lib/tailscale &\n\
|
| 40 |
+
TAILSCALED_PID=$!\n\
|
| 41 |
+
sleep 2\n\
|
| 42 |
+
tailscale up --auth-key="$AUTH_KEY" --hostname="$HOSTNAME" --accept-routes\n\
|
| 43 |
+
echo ""\n\
|
| 44 |
+
echo "=== Container ready ==="\n\
|
| 45 |
+
echo "Tailscale IP: $(tailscale ip -4 2>/dev/null)"\n\
|
| 46 |
+
echo "SSH password: root"\n\
|
| 47 |
+
echo "======================="\n\
|
| 48 |
+
wait $TAILSCALED_PID\n\
|
| 49 |
+
' > /entrypoint.sh && chmod +x /entrypoint.sh
|
| 50 |
+
|
| 51 |
+
EXPOSE 22
|
| 52 |
+
|
| 53 |
+
ENTRYPOINT ["/entrypoint.sh"]
|