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"]