feat: Dockerfile for containerized deployments - #14
Open
dobexx wants to merge 1 commit into
Open
Conversation
Multi-stage build on node:22-slim: - Builder stage compiles TypeScript; runtime stage ships only prod deps - Claude Code CLI preinstalled globally (the proxy wraps it as subprocess) - Non-root user (proxyapp; node:*-slim already ships a system user 'proxy') - Credentials persist via CLAUDE_CONFIG_DIR=/data/.claude - mount a volume on /data so OAuth tokens survive restarts/redeploys - Healthcheck against /health (always public) - HOST=0.0.0.0 + PORT=3456 presets for container networking Tested in production on an EasyPanel (Docker Swarm) host.
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- Consider pinning the Node base image and the
@anthropic-ai/claude-codedependency to specific versions (or using build args) to avoid unexpected breakage from upstream changes. - The
.dockerignorefile is currently empty; add common exclusions likenode_modules,dist,.git, and local config files to minimize build context size and speed up builds. - The healthcheck relies on an inline
node -escript; you might simplify and harden this by using a small shell-based check (e.g.,wget/curlif available) or a dedicated healthcheck script in the repo for easier maintenance.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Consider pinning the Node base image and the `@anthropic-ai/claude-code` dependency to specific versions (or using build args) to avoid unexpected breakage from upstream changes.
- The `.dockerignore` file is currently empty; add common exclusions like `node_modules`, `dist`, `.git`, and local config files to minimize build context size and speed up builds.
- The healthcheck relies on an inline `node -e` script; you might simplify and harden this by using a small shell-based check (e.g., `wget`/`curl` if available) or a dedicated healthcheck script in the repo for easier maintenance.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Author
|
Thanks for the review! Notes on the two points:
@sourcery-ai review |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds a production-ready Dockerfile (+ .dockerignore) so the proxy can run as a container service (Docker Compose, EasyPanel, Kubernetes, ...).
Design:
node:22-slim: builder compiles TypeScript, runtime ships only production depsproxyapp(node:*-slim base images already ship a system user namedproxy, hence the distinct name)CLAUDE_CONFIG_DIR=/data/.claude– mounting a volume on/datakeeps OAuth tokens across restarts/redeploys (the CLI refreshes tokens in place)/healthHOST=0.0.0.0/PORT=3456presets for container networkingContext: PR #9 (Docker CI workflow) was closed without merge – this PR is different in scope: it ships the Dockerfile itself, no CI changes.
Tested: Running in production on an EasyPanel (Docker Swarm) host – build, healthchecks, volume persistence across redeploys all verified live.
Note: pairs naturally with the auth/.env PR I'll open next (the proxy currently has no request authentication, which matters once it listens on a routable address).