| FROM alpine:3.19 | |
| # Install dependencies | |
| RUN apk add --no-cache ca-certificates curl iptables ip6tables iproute2 bash | |
| # Install Tailscale | |
| RUN curl -fsSL https://pkgs.tailscale.com/stable/tailscale_1.56.1_amd64.tgz | tar xz -C /usr/local/bin --strip-components=1 | |
| # Create user | |
| RUN adduser -D -u 1000 megamind | |
| RUN mkdir -p /app/data /var/run/tailscale /var/lib/tailscale | |
| RUN chown -R megamind:megamind /app /var/run/tailscale /var/lib/tailscale | |
| WORKDIR /app | |
| # Copy binary and config | |
| COPY megamind /app/megamind | |
| COPY config.json /app/config.json | |
| COPY startup.sh /app/startup.sh | |
| RUN chmod +x /app/megamind /app/startup.sh | |
| # HF Spaces uses port 7860 | |
| EXPOSE 7860 | |
| CMD ["/app/startup.sh"] | |