claude-docker/scripts/startup.sh
Vishal Jain 9baf9f5c4b Use build args for git user config
Change git configuration to use Docker build args instead of .env file,
simplifying setup and improving security. This change:
- Removes git config from .env and startup.sh
- Adds GIT_USER_NAME and GIT_USER_EMAIL build args
- Updates documentation for new git config approach
- Improves task logging requirements in CLAUDE.md

The build arg approach provides better isolation and ensures git config is
properly set during image build rather than container runtime.
2025-06-18 14:19:18 +01:00

41 lines
1.3 KiB
Bash
Executable File

#!/bin/bash
# ABOUTME: Startup script for Claude Code container with MCP server
# ABOUTME: Loads environment and starts Claude Code with pre-configured Twilio MCP
# Load environment variables from .env if it exists
# Use the .env file baked into the image at build time
if [ -f /app/.env ]; then
echo "Loading environment from baked-in .env file"
set -a
source /app/.env 2>/dev/null || true
set +a
# Export Twilio variables for runtime use
export TWILIO_ACCOUNT_SID
export TWILIO_AUTH_TOKEN
export TWILIO_FROM_NUMBER
export TWILIO_TO_NUMBER
else
echo "WARNING: No .env file found in image."
fi
# 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
# Verify Twilio MCP configuration
if [ -n "$TWILIO_ACCOUNT_SID" ] && [ -n "$TWILIO_AUTH_TOKEN" ]; then
echo "✓ Twilio MCP server configured - SMS notifications enabled"
else
echo "No Twilio credentials found - SMS notifications disabled"
fi
# Git configuration is handled during Docker build from host git config
# Start Claude Code with permissions bypass
echo "Starting Claude Code..."
exec claude --dangerously-skip-permissions "$@"