mirror of
https://github.com/hwchase17/langchain.git
synced 2025-09-04 12:39:32 +00:00
fix: devcontainer (#32260)
This commit is contained in:
41
libs/langchain/dev.Dockerfile
Normal file
41
libs/langchain/dev.Dockerfile
Normal file
@@ -0,0 +1,41 @@
|
||||
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
|
||||
|
||||
RUN pip install --no-cache-dir uv
|
||||
|
||||
WORKDIR /workspaces/langchain
|
||||
|
||||
COPY . .
|
||||
|
||||
# Create uv cache directory and set permissions
|
||||
RUN mkdir -p $UV_CACHE_DIR && chmod 755 $UV_CACHE_DIR
|
||||
|
||||
# Install dependencies using uv (let uv handle the venv creation)
|
||||
RUN uv sync --dev
|
||||
|
||||
# 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", "-c"]
|
||||
CMD ["/bin/bash"]
|
Reference in New Issue
Block a user