#syntax=docker/dockerfile:1
FROM tailscale/tailscale@sha256:dbeff02d2337344b351afac203427218c4d0a06c43fc10a865184063498472a6

RUN apk add --no-cache \
    iptables \
    socat \
    curl \
    bash \
    redsocks

COPY ./post-rules.sh /post-rules.sh
COPY ./redsocks.conf /etc/redsocks.conf
RUN chmod +x /post-rules.sh

# Entrypoint to configure and start Tailscale + traffic redirection
ENTRYPOINT ["/post-rules.sh"]
