FROM alpine:3.21.0

COPY netbird /usr/local/bin/netbird

RUN apk add --no-cache ca-certificates \
    && adduser -D -h /var/lib/netbird netbird
WORKDIR /var/lib/netbird
USER netbird:netbird

ENV NB_FOREGROUND_MODE=true
ENV NB_USE_NETSTACK_MODE=true
ENV NB_ENABLE_NETSTACK_LOCAL_FORWARDING=true
ENV NB_CONFIG=config.json
ENV NB_DAEMON_ADDR=unix://netbird.sock
ENV NB_DISABLE_DNS=true

ENTRYPOINT [ "/usr/local/bin/netbird", "up" ]
