- Python LSP (pylsp + pylsp_i80 plugin): i80 pypi package completions - Bicep LSP (asyncio TCP proxy → Bicep.LangServer.dll): LRU module injection - Health HTTP endpoint (:2089) for Consul/Nomad checks - Startup catalog fetch from pypi-server.i80.dk + DevOpsMCP (no volume needed) - Multi-stage Dockerfile: downloads Bicep LS at build time, dotnet-runtime-8.0 + python3.12 - Nomad job: static TCP ports 2087/2088, health check on 2089 - Gitea Actions CI: build + push + deploy pipeline - Editor configs: Helix / nvim / LSP4IJ / VS Code
61 lines
2.4 KiB
Docker
61 lines
2.4 KiB
Docker
# syntax=docker/dockerfile:1.6
|
|
# iLSP — multi-stage: downloads Bicep LS, then builds the Python package
|
|
# Final image: dotnet runtime + Python 3.12
|
|
|
|
# ── Stage 1: download Bicep Language Server ──────────────────────────────────
|
|
FROM debian:bookworm-slim AS bicep-downloader
|
|
|
|
ARG BICEP_VERSION=latest
|
|
RUN apt-get update && apt-get install -y --no-install-recommends curl unzip ca-certificates \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
COPY scripts/download_bicep_ls.sh /scripts/
|
|
RUN chmod +x /scripts/download_bicep_ls.sh && BICEP_VERSION=${BICEP_VERSION} /scripts/download_bicep_ls.sh
|
|
|
|
|
|
# ── Stage 2: Python wheel build ───────────────────────────────────────────────
|
|
FROM python:3.12-slim AS builder
|
|
|
|
WORKDIR /build
|
|
COPY pyproject.toml .
|
|
COPY ilsp/ ilsp/
|
|
|
|
RUN pip install --upgrade pip build \
|
|
&& python -m build --wheel --outdir /dist
|
|
|
|
|
|
# ── Stage 3: final runtime ────────────────────────────────────────────────────
|
|
FROM python:3.12-slim
|
|
|
|
# Install .NET runtime (needed by Bicep.LangServer.dll)
|
|
RUN apt-get update \
|
|
&& apt-get install -y --no-install-recommends \
|
|
wget apt-transport-https ca-certificates \
|
|
&& wget -q https://packages.microsoft.com/config/debian/12/packages-microsoft-prod.deb \
|
|
&& dpkg -i packages-microsoft-prod.deb && rm packages-microsoft-prod.deb \
|
|
&& apt-get update \
|
|
&& apt-get install -y --no-install-recommends dotnet-runtime-8.0 \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
# Copy Bicep Language Server (baked in at build time — no volume needed)
|
|
COPY --from=bicep-downloader /opt/bicep-langserver /opt/bicep-langserver
|
|
|
|
# Install Python package and dependencies
|
|
COPY --from=builder /dist/*.whl /tmp/
|
|
RUN pip install --no-cache-dir /tmp/*.whl && rm /tmp/*.whl
|
|
|
|
# Configuration defaults (override via Nomad env)
|
|
ENV PYTHON_LSP_PORT=2087 \
|
|
BICEP_LSP_PORT=2088 \
|
|
HEALTH_PORT=2089 \
|
|
BICEP_LS_PATH=/opt/bicep-langserver/Bicep.LangServer.dll \
|
|
DEVOPS_MCP_URL=https://devops-mcp.i80.dk \
|
|
PYTHONUNBUFFERED=1
|
|
|
|
EXPOSE 2087 2088 2089
|
|
|
|
HEALTHCHECK --interval=15s --timeout=5s --retries=3 \
|
|
CMD wget -qO- http://localhost:${HEALTH_PORT}/health || exit 1
|
|
|
|
CMD ["ilsp"]
|