mongomind-mcp/Dockerfile
Pappmann 6f810b129c Add MicroK8s deployment manifests for node1 (mongomind-http, Keycloak+Postgres)
node1 is migrating off Docker CE/bare-metal to MicroK8s incrementally. Adds
the Docker image build (Dockerfile, .dockerignore) and Kubernetes manifests
for both services now running there: mongomind-http (namespace `mongomind`,
NodePort 30642, mongod stays bare-metal and is reached via the host-access
addon) and Keycloak+Postgres (namespace `keycloak`, NodePort 30080, Postgres
on a hostpath-storage PVC seeded from a pg_dump of the prior Docker Compose
volume).

Secrets are deliberately not declared as YAML with embedded values — they're
created imperatively from the existing 0600-protected sources on node1
(.mongomind_env, projects.json, the compose .env), documented with exact
commands in deploy/k8s/README.md, so no credential lands in git history.
Both apps validate that their credential/registry files are owned by the
running uid; since Secret volumes are always root-owned, deployment.yaml
uses an initContainer to copy the projects.json Secret into an emptyDir and
chown it to the app user.

The Keycloak Deployment needed a startupProbe: its ~90-120s Quarkus cold
start (repeated on every fresh container, no persisted build cache) was
being killed by an impatient livenessProbe just before it finished, which
restarted it into the same slow build loop indefinitely.

Both services are cut over in production (Caddy repointed from the old
bare-metal/Docker Compose ports to the new NodePorts) and verified via a
real OAuth round-trip through the existing mongomind-web MCP client. The old
systemd unit and Docker Compose stack are left running untouched as instant
rollback for a few days before being decommissioned.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-10 04:54:01 +02:00

12 lines
296 B
Docker

FROM python:3.12-slim
WORKDIR /app
COPY pyproject.toml LICENSE COMMERCIAL-LICENSE.md README.md ./
COPY mongomind ./mongomind
RUN pip install --no-cache-dir . \
&& useradd --create-home --uid 1000 --shell /usr/sbin/nologin mongomind
USER mongomind
EXPOSE 8642
ENTRYPOINT ["mongomind-http"]