diff --git a/images/base/dockerfile b/images/base/dockerfile new file mode 100644 index 0000000..fe12d22 --- /dev/null +++ b/images/base/dockerfile @@ -0,0 +1,22 @@ +FROM python:3.12-slim-bookworm AS base + +LABEL org.opencontainers.image.title="tenant-base" \ + org.opencontainers.image.description="Hardened base image for tenant workspaces" \ + org.opencontainers.image.source="https://git.bouvais.lu/adrien/" + +# System deps only — keep this layer stable so it's rarely rebuilt +RUN apt-get update && apt-get install -y --no-install-recommends \ + ca-certificates \ + curl \ + tini \ + && rm -rf /var/lib/apt/lists/* + +# Non-root user, fixed UID/GID for predictable K8s securityContext +RUN groupadd --gid 1000 appuser \ + && useradd --uid 1000 --gid appuser --shell /bin/bash --create-home appuser + +WORKDIR /home/appuser +USER appuser + +ENTRYPOINT ["tini", "--"] + diff --git a/images/jupyter/dockerfile b/images/jupyter/dockerfile new file mode 100644 index 0000000..2a98689 --- /dev/null +++ b/images/jupyter/dockerfile @@ -0,0 +1,24 @@ +ARG BASE_IMAGE=registry.bouvais.lu/tenant-base:1.0.0 +FROM ${BASE_IMAGE} + +LABEL org.opencontainers.image.title="tenant-jupyter" \ + org.opencontainers.image.description="JupyterLab image built on tenant-base" \ + org.opencontainers.image.base.name="${BASE_IMAGE}" + +USER root +COPY --chown=appuser:appuser requirements.txt /tmp/requirements.txt +RUN pip install --no-cache-dir -r /tmp/requirements.txt \ + && rm /tmp/requirements.txt + +# No secrets baked in — S3 creds come from a mounted K8s Secret / env at runtime +USER appuser +WORKDIR /home/appuser/work + +EXPOSE 8888 + +CMD ["jupyter", "lab", \ + "--ip=0.0.0.0", \ + "--port=8888", \ + "--no-browser", \ + "--ServerApp.token=", \ + "--ServerApp.allow_remote_access=True"] diff --git a/images/jupyter/requirements.txt b/images/jupyter/requirements.txt new file mode 100644 index 0000000..22a9314 --- /dev/null +++ b/images/jupyter/requirements.txt @@ -0,0 +1,4 @@ +jupyterlab==4.2.5 +boto3==1.35.0 +s3fs==2024.9.0 +pandas==2.2.2