FROM python:3.15-0a7-slim-bookworm
# Set environment variables for Python and uv
ENV PYTHONUNBUFFERED=1 \
PYTHONDONTWRITEBYTECODE=1 \
PIP_NO_CACHE_DIR=1 \
PIP_DISABLE_PIP_VERSION_CHECK=1 \
UV_CACHE_DIR=/tmp/uv-cache
# Install system dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
curl \
git \
vim \
less \
ca-certificates \
&& rm -rf /var/lib/apt/lists/* \
&& apt-get clean
# Install uv to manage environments
RUN pip install --no-cache-dir uv
WORKDIR /workspaces/langchain
# Copy source code
COPY . .
# Create uv cache directory and set permissions
RUN mkdir -p $UV_CACHE_DIR && chmod 755 $UV_CACHE_DIR
# Install dependencies for the repo using uv (let uv handle the venv creation)
WORKDIR /workspaces/langchain/libs/langchain_v1
RUN uv sync --dev
WORKDIR /workspaces/langchain
# Create a non-root user and set up proper permissions
RUN useradd -m -s /bin/bash -u 1000 vscode && \
chown -R vscode:vscode /workspaces $UV_CACHE_DIR
USER vscode
# Set shell for interactive use
SHELL ["/bin/bash", "-lc"]
CMD ["/bin/bash"]
Image python:3.15-slim-bookworm NOT found on Docker Hub.
Image python:3.15-slim-bookworm NOT found on Docker Hub.
FROM python:3.11-slim-bookworm
# Set environment variables for Python and uv
ENV PYTHONUNBUFFERED=1 \
PYTHONDONTWRITEBYTECODE=1 \
PIP_NO_CACHE_DIR=1 \
PIP_DISABLE_PIP_VERSION_CHECK=1 \
UV_CACHE_DIR=/tmp/uv-cache
# Install system dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
curl \
git \
vim \
less \
ca-certificates \
&& rm -rf /var/lib/apt/lists/* \
&& apt-get clean
# Install uv to manage environments
RUN python -m pip install --no-cache-dir uv
WORKDIR /workspaces/langchain
# Copy source code
COPY . .
# Create uv cache directory and set permissions
RUN mkdir -p $UV_CACHE_DIR && chmod 755 $UV_CACHE_DIR
# Install dependencies for the repo using uv (let uv handle the venv creation)
WORKDIR /workspaces/langchain/libs/langchain_v1
RUN uv sync --dev
WORKDIR /workspaces/langchain
# Create a non-root user and set up proper permissions
RUN useradd -m -s /bin/bash -u 1000 vscode && \
chown -R vscode:vscode /workspaces $UV_CACHE_DIR
USER vscode
# Set shell for interactive use
SHELL ["/bin/bash", "-lc"]
CMD ["/bin/bash"]
Concerns: COPY . . may copy the entire repository including large files or build caches; consider adding a .dockerignore to reduce image size and build time, The build relies on uv sync --dev to set up dependencies; ensure libs/langchain_v1 exists and contains a valid pyproject/requirements for uv to install, The image includes extra tooling (vim, less) and creates a non-root user; while not inherently harmful, these may be unnecessary for a production image Smoke [PASS]: command -v uv >/dev/null 2>&1 && echo uv_present Smoke [PASS]: test -d /workspaces/langchain/libs/langchain_v1 && echo langchain_v1_dir_present Smoke [PASS]: python -V