# BROARchat router ports (UPnP): alpine + miniupnpc's `upnpc`. Runs with host networking
# (compose profile "upnp", only when .env says UPNP=1): maps this server's ports to its LAN
# address at start and hourly, and removes only its own mappings on SIGTERM.
FROM alpine:3.24.4@sha256:f59abe656b692d901e184be3445e084786602108599d2a51d229c0f5a48c71bf

RUN apk add --no-cache "miniupnpc~2.3"

COPY upnp.sh /usr/local/bin/broarchat-upnp
RUN chmod 755 /usr/local/bin/broarchat-upnp

ENTRYPOINT ["/bin/sh", "/usr/local/bin/broarchat-upnp"]
