chore: Update Dockerfile to optimize build process and configure Clau…#52
chore: Update Dockerfile to optimize build process and configure Clau…#52
Conversation
…de Code CLI settings
|
The preview deployment for sefaria/ai-chatbot:client is ready. 🟢 Open Preview | Open Build Logs | Open Application Logs Last updated at: 2026-02-25 11:47:44 CET |
There was a problem hiding this comment.
Pull request overview
This pull request optimizes the Docker build process and configures the Claude Code CLI with system-level and user-level settings. The changes improve build caching efficiency and ensure the Claude Code CLI has proper configuration directories when the container runs.
Changes:
- Optimized Docker layer caching by copying package.json and package-lock.json separately before other files and switching from
npm installtonpm cifor reproducible builds - Pinned
@anthropic-ai/claude-codeto version 2.1.56 for reproducible builds - Created system-level and user-level Claude Code CLI configuration directories with empty JSON settings files
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Files created under /home/appuser/ in the image are invisible at runtime since the deployment mounts an emptyDir over the entire home directory. remote-settings.json is now created by the claude-settings init container. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Two changes to fix the hundreds of ENOENT errors on remote-settings.json: 1. Downgrade @anthropic-ai/claude-code from 2.1.37 to 2.1.37 (version before the problematic directory-wiping behavior was introduced) 2. Add entrypoint wrapper that runs `claude --version` before gunicorn starts, triggering CLI first-run initialization once per pod lifecycle so all ~/.claude/ files exist before the first request arrives Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Removed the entrypoint script that pre-warmed the Claude CLI, directly invoking gunicorn instead. This change streamlines the Dockerfile and eliminates unnecessary complexity while maintaining application startup functionality.
…LI settings Added a command to set read permissions for the managed settings directory, allowing the non-root user to access the configuration files. This change enhances the security and functionality of the Docker image.
…de Code CLI settings