Skip to main content

Docker Tailscale NAS


Buat Compose Docker​

version: "3.7"

services:

ts-authkey-test:
image: tailscale/tailscale:latest
container_name: ts-authkey-test
hostname: authkey-test

restart: unless-stopped

environment:
- TS_AUTHKEY=tskey-auth-kV8X8yPSt421CNTRL-GDnsDjBakSX1UAkrvVtmSXUnr7BhinQy
- TS_STATE_DIR=/var/lib/tailscale
- TS_USERSPACE=false

devices:
- /dev/net/tun:/dev/net/tun

cap_add:
- NET_ADMIN

volumes:
- ./tailscale-state:/var/lib/tailscale

ssh-root:
image: almalinux:9
container_name: ssh-root

restart: unless-stopped

network_mode: service:ts-authkey-test

stdin_open: true
tty: true

command: >
bash -c "
dnf install -y openssh-server passwd &&
ssh-keygen -A &&
echo 'root:rootpassword' | chpasswd &&
sed -i 's/#PermitRootLogin yes/PermitRootLogin yes/' /etc/ssh/sshd_config &&
echo 'PasswordAuthentication yes' >> /etc/ssh/sshd_config &&
mkdir -p /run/sshd &&
/usr/sbin/sshd -D -p 5512 -e
"

volumes:
- /home/jagoankode:/u_nas

nginx-authkey-test:
image: nginx
network_mode: service:ts-authkey-test

Install Rsync​

dnf install -y rsync