FROM alpine:3.19 AS build RUN --mount=type=cache,target=/var/cache/apk/,sharing=locked \ apk update &&\ apk add python3 python3-dev pipx gcc musl-dev linux-headers RUN adduser luser --system -s /bin/sh -h /var/lib/jupyter USER luser WORKDIR /var/lib/jupyter RUN pipx install jupyter-core RUN pipx inject jupyter-core jupyterlab RUN pipx inject jupyter-core ipywidgets RUN pipx inject jupyter-core jupyterlab-lsp RUN pipx inject jupyter-core python-lsp-server[yapf,rope,pyflakes] RUN pipx inject jupyter-core pylsp-mypy RUN pipx inject jupyter-core matplotlib RUN pipx inject jupyter-core numpy FROM alpine:3.19 RUN --mount=type=cache,target=/var/cache/apk/,sharing=locked \ apk update &&\ apk add python3 texlive texlive-xetex texlive-full RUN adduser luser --system -s /bin/sh -h /var/lib/jupyter USER luser WORKDIR /var/lib/jupyter COPY --from=build /var/lib/jupyter /var/lib/jupyter ENV PATH="/var/lib/jupyter/.local/bin/:$PATH" ENTRYPOINT ["jupyter", "lab", "--no-browser", "--ip=0.0.0.0"] EXPOSE 8888/tcp