Skip to content

Commit 9d18bf2

Browse files
committed
trawl: alpine
1 parent 6aac762 commit 9d18bf2

1 file changed

Lines changed: 16 additions & 15 deletions

File tree

‎trawl/Dockerfile‎

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,21 @@
1-
FROM debian:trixie-slim
2-
3-
RUN apt-get update && \
4-
apt-get install -y --no-install-recommends \
5-
wireguard-tools iproute2 iptables \
6-
rclone rsync lsyncd sshfs fuse3 \
7-
openssh-client dropbear \
8-
socat netcat-openbsd curl wget jq \
9-
inotify-tools tcpdump mtr-tiny dnsutils \
10-
procps strace tmux file less zstd && \
11-
rm -rf /var/lib/apt/lists/* && \
1+
FROM alpine:3.23
2+
3+
RUN apk add --no-cache \
4+
tini bash \
5+
wireguard-tools iproute2 iptables \
6+
rclone rsync lsyncd sshfs fuse3 \
7+
openssh-client-default dropbear \
8+
socat netcat-openbsd curl wget jq \
9+
inotify-tools tcpdump mtr bind-tools \
10+
procps strace tmux file less zstd stunnel && \
1211
mkdir -p /etc/wireguard /data
1312

1413
VOLUME ["/data", "/etc/wireguard"]
1514
EXPOSE 51820/udp
1615

16+
HEALTHCHECK --interval=30s --timeout=5s \
17+
CMD wg show | grep -q "latest handshake" || exit 1
18+
1719
RUN cat > /entrypoint.sh << 'SCRIPT'
1820
#!/bin/bash
1921
set -e
@@ -27,7 +29,6 @@ cleanup() {
2729
}
2830
trap cleanup SIGTERM SIGINT
2931

30-
# generate default wg0 only if no configs exist
3132
if ! ls /etc/wireguard/wg*.conf 2>/dev/null | grep -q .; then
3233
[ -f /etc/wireguard/privatekey ] || {
3334
wg genkey | tee /etc/wireguard/privatekey | wg pubkey > /etc/wireguard/publickey
@@ -37,17 +38,16 @@ if ! ls /etc/wireguard/wg*.conf 2>/dev/null | grep -q .; then
3738
cat > /etc/wireguard/wg0.conf << EOF
3839
[Interface]
3940
PrivateKey = $(cat /etc/wireguard/privatekey)
40-
Address = ${WG_IP:-192.168.192.2}/32
41+
Address = ${WG_IP:-100.87.143.201}/32
4142
ListenPort = 51820
4243

4344
[Peer]
4445
PublicKey = ${WG_CLIENT_PUBKEY:-CHANGEME}
45-
AllowedIPs = ${WG_CLIENT_IP:-192.168.192.1}/32
46+
AllowedIPs = ${WG_CLIENT_IP:-100.87.143.1}/32
4647
EOF
4748
chmod 600 /etc/wireguard/wg0.conf
4849
fi
4950

50-
# bring up all WG interfaces
5151
for conf in /etc/wireguard/wg*.conf; do
5252
[ -f "$conf" ] && wg-quick up "$(basename "${conf%.conf}")" && \
5353
echo "[INFO] up: $(basename "${conf%.conf}")"
@@ -57,4 +57,5 @@ exec ${CMD:-sleep infinity}
5757
SCRIPT
5858

5959
RUN chmod +x /entrypoint.sh
60+
ENTRYPOINT ["/sbin/tini", "--"]
6061
CMD ["/entrypoint.sh"]

0 commit comments

Comments
 (0)