From ecaf3c656d1f42bb307ba0db2ddf3c5357b549b8 Mon Sep 17 00:00:00 2001 From: xrendan Date: Fri, 27 Mar 2026 13:35:02 -0600 Subject: [PATCH] Install Claude as rails user and add ~/.local/bin to PATH Instead of installing as root and moving to /usr/local/bin, install after switching to the rails user so it lands in ~/.local/bin by default, then add that to PATH. Co-Authored-By: Claude Sonnet 4.6 --- Dockerfile | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index 6ffdb5c..de91f09 100644 --- a/Dockerfile +++ b/Dockerfile @@ -77,17 +77,17 @@ FROM base COPY --from=build "${BUNDLE_PATH}" "${BUNDLE_PATH}" COPY --from=build /rails /rails -# Install Claude Code (native binary) -RUN curl -fsSL https://claude.ai/install.sh | bash && \ - mv /root/.local/bin/claude /usr/local/bin/claude && \ - chmod 755 /usr/local/bin/claude - # Run and own only the runtime files as a non-root user for security RUN groupadd --system --gid 1000 rails && \ useradd rails --uid 1000 --gid 1000 --create-home --shell /bin/bash && \ chown -R rails:rails db log storage tmp USER 1000:1000 +# Install Claude Code as the rails user +RUN curl -fsSL https://claude.ai/install.sh | bash + +ENV PATH="/home/rails/.local/bin:$PATH" + # Entrypoint prepares the database. ENTRYPOINT ["/rails/bin/docker-entrypoint"]