chore: migrate container Dockerfile to pnpm with corepack
Enable corepack and PNPM_HOME in container, switch all npm/npx invocations to pnpm/pnpm exec. Use wildcard COPY for optional pnpm-lock.yaml in agent-runner.
This commit is contained in:
@@ -30,23 +30,28 @@ RUN apt-get update && apt-get install -y \
|
|||||||
ENV AGENT_BROWSER_EXECUTABLE_PATH=/usr/bin/chromium
|
ENV AGENT_BROWSER_EXECUTABLE_PATH=/usr/bin/chromium
|
||||||
ENV PLAYWRIGHT_CHROMIUM_EXECUTABLE_PATH=/usr/bin/chromium
|
ENV PLAYWRIGHT_CHROMIUM_EXECUTABLE_PATH=/usr/bin/chromium
|
||||||
|
|
||||||
|
# Enable pnpm via corepack
|
||||||
|
ENV PNPM_HOME="/pnpm"
|
||||||
|
ENV PATH="$PNPM_HOME:$PATH"
|
||||||
|
RUN corepack enable
|
||||||
|
|
||||||
# Install agent-browser and claude-code globally
|
# Install agent-browser and claude-code globally
|
||||||
RUN npm install -g agent-browser @anthropic-ai/claude-code vercel
|
RUN pnpm install -g agent-browser @anthropic-ai/claude-code vercel
|
||||||
|
|
||||||
# Create app directory
|
# Create app directory
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
# Copy package files first for better caching
|
# Copy package files first for better caching
|
||||||
COPY agent-runner/package*.json ./
|
COPY agent-runner/package.json agent-runner/pnpm-lock.yaml* ./
|
||||||
|
|
||||||
# Install dependencies
|
# Install dependencies
|
||||||
RUN npm install
|
RUN pnpm install --frozen-lockfile
|
||||||
|
|
||||||
# Copy source code
|
# Copy source code
|
||||||
COPY agent-runner/ ./
|
COPY agent-runner/ ./
|
||||||
|
|
||||||
# Build TypeScript
|
# Build TypeScript
|
||||||
RUN npm run build
|
RUN pnpm run build
|
||||||
|
|
||||||
# Create workspace directories
|
# Create workspace directories
|
||||||
RUN mkdir -p /workspace/group /workspace/global /workspace/extra
|
RUN mkdir -p /workspace/group /workspace/global /workspace/extra
|
||||||
@@ -56,7 +61,7 @@ RUN mkdir -p /workspace/group /workspace/global /workspace/extra
|
|||||||
# recompiles on startup — this lets host source edits and skill installs
|
# recompiles on startup — this lets host source edits and skill installs
|
||||||
# take effect without rebuilding the image. All IO goes through the session
|
# take effect without rebuilding the image. All IO goes through the session
|
||||||
# DBs (inbound.db / outbound.db) mounted into /workspace.
|
# DBs (inbound.db / outbound.db) mounted into /workspace.
|
||||||
RUN printf '#!/bin/bash\nset -e\ncd /app && npx tsc --outDir /tmp/dist 2>&1 >&2\nln -s /app/node_modules /tmp/dist/node_modules\nchmod -R a-w /tmp/dist\ncat > /tmp/input.json\nnode /tmp/dist/index.js < /tmp/input.json\n' > /app/entrypoint.sh && chmod +x /app/entrypoint.sh
|
RUN printf '#!/bin/bash\nset -e\ncd /app && pnpm exec tsc --outDir /tmp/dist 2>&1 >&2\nln -s /app/node_modules /tmp/dist/node_modules\nchmod -R a-w /tmp/dist\ncat > /tmp/input.json\nnode /tmp/dist/index.js < /tmp/input.json\n' > /app/entrypoint.sh && chmod +x /app/entrypoint.sh
|
||||||
|
|
||||||
# Set ownership to node user (non-root) for writable directories
|
# Set ownership to node user (non-root) for writable directories
|
||||||
RUN chown -R node:node /workspace && chmod 777 /home/node
|
RUN chown -R node:node /workspace && chmod 777 /home/node
|
||||||
|
|||||||
Reference in New Issue
Block a user