28 lines
972 B
Docker
28 lines
972 B
Docker
# Python stack overlay fragment.
|
|
#
|
|
# Layer this on top of huskies-project-base to produce a project container
|
|
# with Python 3, pip, and pyright (the Microsoft Python LSP / type checker).
|
|
#
|
|
# Build the combined image:
|
|
# (echo "FROM huskies-project-base"; \
|
|
# cat docker/stacks/python/Dockerfile.fragment) | \
|
|
# docker build -t huskies-project-python -
|
|
#
|
|
# Adding a new stack: create docker/stacks/<name>/Dockerfile.fragment and
|
|
# docker/stacks/<name>/markers — no changes to orchestration code required.
|
|
|
|
USER root
|
|
|
|
# Python 3 runtime and pip.
|
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
python3 \
|
|
python3-pip \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
# pyright: Microsoft's Python language server / static type checker.
|
|
# --break-system-packages is required on Debian 12+ where pip is externally
|
|
# managed; the flag is safe inside a Docker container.
|
|
RUN pip install --no-cache-dir --break-system-packages pyright
|
|
|
|
USER huskies
|