FROM debian:trixie-slim
RUN apt-get update && apt-get install -y --no-install-recommends dnsmasq-base python3 \
    && rm -rf /var/lib/apt/lists/*
WORKDIR /app
COPY configure.py /app/configure.py
COPY routes.example.json /config/routes.json
EXPOSE 53/udp 53/tcp
CMD ["sh", "-ec", "python3 /app/configure.py /config/routes.json /tmp/dnsmasq.conf; exec dnsmasq --keep-in-foreground --conf-file=/tmp/dnsmasq.conf --log-facility=-"]
