Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 73 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
node_modules
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Coverage directory used by tools like istanbul
coverage
*.lcov

# Logs
logs
*.log

# Dependency directories
node_modules/
jspm_packages/

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env
.env.local
.env.development.local
.env.test.local
.env.production.local

# IDE files
.vscode/
.idea/
*.swp
*.swo
*~

# OS generated files
.DS_Store
.DS_Store?
._*
.Spotlight-V100
.Trashes
ehthumbs.db
Thumbs.db

# Git
.git
.gitignore

# Docker
Dockerfile*
docker-compose*
.dockerignore

# Build output
dist/
build/

# Development files
.env.example
45 changes: 45 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Use Node.js version from .nvmrc
FROM node:20.19.3-alpine

# Set working directory
WORKDIR /app

# Install system dependencies needed for some npm packages
RUN apk add --no-cache \
python3 \
make \
g++ \
sqlite \
curl

# Install Claude Code CLI
RUN npm install -g @anthropic-ai/claude-code

# Copy package files
COPY package*.json ./

# Install all dependencies (including dev dependencies for build)
RUN npm ci

# Copy source code
COPY . .

# Build the frontend
RUN npm run build

# Remove dev dependencies to reduce image size
RUN npm ci --only=production && npm cache clean --force

# Create non-root user for security
RUN addgroup -g 1001 -S nodejs
RUN adduser -S nextjs -u 1001

# Change ownership of app directory
RUN chown -R nextjs:nodejs /app
USER nextjs

# Expose port
EXPOSE 3008

# Start the server only (build already completed)
CMD ["npm", "run", "server"]
29 changes: 28 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,38 @@ cp .env.example .env
# Development mode (with hot reload)
npm run dev

# Production mode
npm start
```
The application will start at the port you specified in your .env

5. **Open your browser:**
- Development: `http://localhost:3001`
- Development: `http://localhost:3009`
- Production: `http://localhost:3008`

### Docker Installation (Recommended)

For easier deployment and consistent environment:

1. **Clone and setup:**
```bash
git clone https://github.com/siteboon/claudecodeui.git
cd claudecodeui
```

2. **Run with Docker Compose:**
```bash
docker-compose up -d
```

3. **Open your browser:**
- Application: `http://localhost:3008`

**Docker benefits:**
- Consistent environment across all platforms
- No need to install Node.js or manage dependencies
- Automatic restart on system reboot
- Persistent data storage for sessions and projects

## Security & Tools Configuration

Expand Down
29 changes: 29 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
services:
claude-code-ui:
build: .
ports:
- "3008:3008"
environment:
- PORT=3008
- VITE_PORT=3009
- NODE_ENV=production
volumes:
# Mount a volume for the SQLite database to persist data
- claude_data:/app/server/database
# Mount Claude Code directories and projects from host
- ~/.claude:/home/nextjs/.claude:ro
- ~/:/home/nextjs/host_home:ro
# Mount common project directories (adjust paths as needed)
- ~/Projects:/home/nextjs/Projects
- ~/Documents:/home/nextjs/Documents
restart: unless-stopped
healthcheck:
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:3008/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s

volumes:
claude_data:
driver: local