# Blazar Polygon plugin: MCP (streamable HTTP) + REST API. Read-only by default; never put keys in this image.
#   docker build -t blazar-polygon-plugin .             (from a dir with this Dockerfile)
#   docker run -p 8788:8788 blazar-polygon-plugin       # MCP at http://localhost:8788/mcp
#   docker run -p 8787:8787 blazar-polygon-plugin blazar-polygon-api   # REST at http://localhost:8787
# Until the package is on npm, copy the tarball next to this file and use the LOCAL lines.
FROM node:22-slim
ENV NODE_ENV=production MCP_HOST=0.0.0.0 MCP_PORT=8788 HOST=0.0.0.0 PORT=8787
WORKDIR /app
# LOCAL: COPY blazar-polygon-plugin-0.5.2.tgz ./
# LOCAL: RUN npm install -g --omit=dev ./blazar-polygon-plugin-0.5.2.tgz && rm -f ./*.tgz
RUN npm install -g --omit=dev blazar-polygon-plugin@0.5.2
USER node
EXPOSE 8788 8787
HEALTHCHECK CMD node -e "fetch('http://127.0.0.1:'+(process.env.MCP_PORT||8788)+'/health').then(r=>process.exit(r.ok?0:1)).catch(()=>process.exit(1))"
ENTRYPOINT []
CMD ["blazar-polygon-plugin", "--http"]
