claude-docker/scripts/startup.sh
Vishal Jain dcc936dc10 Implement authentication persistence for Claude Docker
- Add persistent volume mount for Claude home directory (~/.claude)
- Create non-root user in Docker container for better security
- Mount host ~/.claude-docker/claude-home to container ~/.claude
- Update install script to create claude-home directory
- Check for existing credentials on startup
- Authentication tokens now persist across container restarts
2025-06-12 14:09:10 +01:00

30 lines
991 B
Bash
Executable File

#!/bin/bash
# ABOUTME: Startup script for Claude Code container with MCP server
# ABOUTME: Configures environment and starts Claude Code with Twilio MCP integration
# Load environment variables from .env if it exists
if [ -f /app/.env ]; then
set -a
source /app/.env 2>/dev/null || true
set +a
fi
# Configure Claude Code to use the MCP server
export CLAUDE_MCP_CONFIG=/app/config/mcp-config.json
# Check for existing authentication
if [ -f "$HOME/.claude/.credentials.json" ]; then
echo "Found existing Claude authentication"
else
echo "No existing authentication found - you will need to log in"
echo "Your login will be saved for future sessions"
fi
# Start Claude Code with permissions bypass
echo "Starting Claude Code..."
if [ -n "$TWILIO_ACCOUNT_SID" ] && [ -n "$TWILIO_API_KEY" ]; then
echo "Twilio MCP integration enabled"
else
echo "No Twilio credentials found, MCP features will be unavailable"
fi
exec claude --dangerously-skip-permissions "$@"