Files
claude-hub/scripts/runtime/startup.sh
Cheffromspace 295c182351 fix: Improve production deployment configuration (#155)
* fix: Improve production deployment configuration

- Update default port from 3003 to 3002 for consistency
- Make port configurable via environment variable in docker-compose
- Add .env file loading support in start-api.sh
- Optimize startup.sh for production (skip builds, expect pre-built dist)
- Make Claude Code image build conditional on Dockerfile availability
- Fix rate limiting configuration for proxy environments
- Remove jest types from tsconfig (not needed in production)

These changes improve deployment flexibility and production readiness.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* fix: Address PR review feedback

- Fix port inconsistency: Change hardcoded 3003 to 3002 in src/index.ts
- Fix security risk: Replace unsafe export command with set -a/source/set +a
- Remove unnecessary Dockerfile.claudecode volume mount from docker-compose
  (The Dockerfile already copies all necessary files during build)

These changes address all critical issues identified in the PR review.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

---------

Co-authored-by: Claude <noreply@anthropic.com>
2025-06-01 13:10:15 -05:00

25 lines
865 B
Bash
Executable File

#!/bin/bash
echo "Starting Claude GitHub webhook service..."
# Build the Claude Code runner image if we have access to Dockerfile.claudecode
if [ -f "Dockerfile.claudecode" ]; then
echo "Building Claude Code runner image..."
if docker build -f Dockerfile.claudecode -t claude-code-runner:latest .; then
echo "Claude Code runner image built successfully."
else
echo "Warning: Failed to build Claude Code runner image. Service will attempt to build on first use."
fi
else
echo "Dockerfile.claudecode not found, skipping Claude Code runner image build."
fi
# In production, dist directory is already built in the Docker image
if [ ! -d "dist" ]; then
echo "Error: dist directory not found. Please rebuild the Docker image."
exit 1
fi
# Start the webhook service
echo "Starting webhook service..."
exec node dist/index.js