Add Python support with uv package manager in Docker container

This commit is contained in:
Chris Scott committed 2025-12-13 00:39:09 -05:00
1 parent 88736cb21e
commit e45ebd96a0
4 files changed
+35 -2

No files matched your search

+8
View File
@@ -16,6 +16,9 @@ RUN apt-get update && apt-get install -y \
less \
tree \
file \
python3 \
python3-pip \
python3-venv \
&& rm -rf /var/lib/apt/lists/*
RUN corepack enable && corepack prepare pnpm@9.15.0 --activate
@@ -25,6 +28,11 @@ RUN curl -fsSL https://bun.sh/install | bash && \
chmod -R 755 /opt/bun && \
ln -s /opt/bun/bin/bun /usr/local/bin/bun
RUN curl -LsSf https://astral.sh/uv/install.sh | sh && \
mv /root/.local/bin/uv /usr/local/bin/uv && \
mv /root/.local/bin/uvx /usr/local/bin/uvx && \
chmod +x /usr/local/bin/uv /usr/local/bin/uvx
WORKDIR /app
FROM base AS deps
+8
View File
@@ -59,11 +59,19 @@ Always bind to \`0.0.0.0\` to allow external access from the Docker host.
## Package Management
### Node.js Packages
Prefer **pnpm** or **bun** over npm for installing dependencies to save disk space:
- Use \`pnpm install\` instead of \`npm install\`
- Use \`bun install\` as an alternative
- Both are pre-installed in the container
### Python Packages
Prefer **uv** for Python package management:
- Use \`uv venv\` to create virtual environments instead of \`python -m venv\`
- Use \`uv pip install\` to install packages instead of \`pip install\`
- Use \`uv pip\` for all pip operations
- uv is pre-installed in the container and provides faster package installation
## General Guidelines
- This file is merged with any AGENTS.md files in individual repositories
@@ -491,7 +491,7 @@ export function PromptInput({
return (
<div className="relative backdrop-blur-md bg-background opacity-95 border border-border dark:border-white/30 rounded-xl p-2 md:p-3 md:mx-4 mb-4 md:mb-1 w-[94%] md:max-w-4xl">
{hasActiveStream && (
<div className="">
<div className="pb-1">
<SessionStatusIndicator sessionID={sessionID} />
</div>
)}
+18 -1
View File
@@ -3,7 +3,7 @@ set -e
export HOME=/home/node
export BUN_INSTALL="$HOME/.bun"
export PATH="$BUN_INSTALL/bin:$HOME/.opencode/bin:$HOME/.local/bin:$PATH"
export PATH="$BUN_INSTALL/bin:$HOME/.opencode/bin:$HOME/.local/bin:/usr/local/bin:$PATH"
echo "🔍 Checking Bun installation..."
@@ -22,6 +22,23 @@ else
echo "✅ Bun is installed (version: $BUN_VERSION)"
fi
echo "🔍 Checking uv installation..."
if ! command -v uv >/dev/null 2>&1; then
echo "❌ uv not found. Installing..."
curl -LsSf https://astral.sh/uv/install.sh | sh
if ! command -v uv >/dev/null 2>&1; then
echo "❌ Failed to install uv. Exiting."
exit 1
fi
echo "✅ uv installed successfully"
else
UV_VERSION=$(uv --version 2>&1 || echo "unknown")
echo "✅ uv is installed (version: $UV_VERSION)"
fi
echo "🔍 Checking OpenCode installation..."
MIN_OPENCODE_VERSION="1.0.137"