Skip to content

Commit fb8703d

Browse files
committed
Update CLAUDE.md to latest version
1 parent 60c0183 commit fb8703d

1 file changed

Lines changed: 81 additions & 9 deletions

File tree

CLAUDE.md

Lines changed: 81 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,90 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
44

55
## Project Overview
66

7-
This is a Docker Compose setup for Ghost, a modern publishing platform. The repository currently contains a minimal structure with a `compose.yml` file for containerized deployment.
7+
This is a comprehensive Docker Compose setup for running Ghost CMS in production with automatic HTTPS, optional analytics, and ActivityPub support. The repository orchestrates multiple services including Ghost, MySQL, Caddy (reverse proxy), and optional Tinybird analytics and ActivityPub federation.
8+
9+
## Architecture
10+
11+
The project uses Docker Compose to orchestrate these services:
12+
13+
1. **Ghost** - The main CMS application (runs on internal port 2368)
14+
2. **MySQL** - Database backend with health checks and support for multiple databases
15+
3. **Caddy** - Reverse proxy handling HTTPS/SSL, routing, and external access
16+
4. **Traffic Analytics** (optional profile) - Tinybird integration for web analytics
17+
5. **ActivityPub** (optional profile) - Federated social networking support
18+
6. **Supporting services** - Tinybird setup tools and ActivityPub migrations
19+
20+
Services communicate internally via Docker networks. Caddy handles all external traffic routing including special paths for analytics (`/_tinybird`) and ActivityPub (`/.well-known/`, `/activitypub/`).
821

922
## Common Commands
1023

11-
Since this is a Docker Compose project, the primary commands will be:
24+
```bash
25+
# Core operations
26+
docker compose up -d # Start Ghost + MySQL + Caddy
27+
docker compose down # Stop all services
28+
docker compose logs -f [service] # View logs (e.g., ghost, mysql, caddy)
29+
docker compose ps # Check service status
30+
docker compose pull # Update all images
31+
docker compose restart ghost # Restart just Ghost
1232

13-
- `docker compose up -d` - Start Ghost services in detached mode
14-
- `docker compose down` - Stop and remove Ghost services
15-
- `docker compose logs` - View service logs
16-
- `docker compose ps` - View running services
17-
- `docker compose pull` - Pull latest images
33+
# With optional profiles
34+
docker compose --profile=analytics up -d # Include analytics services
35+
docker compose --profile=activitypub up -d # Include ActivityPub services
36+
COMPOSE_PROFILES=analytics,activitypub docker compose up -d # Start everything
1837

19-
## Architecture
38+
# Tinybird analytics setup (if using analytics profile)
39+
docker compose run --rm tinybird-login # Interactive Tinybird login
40+
docker compose --profile=analytics up tinybird-sync # Sync datasources/pipes
41+
docker compose --profile=analytics up tinybird-deploy # Deploy configuration
42+
43+
# Development & debugging
44+
docker compose exec ghost sh # Access Ghost container shell
45+
docker compose exec mysql mysql -u root -p # Access MySQL CLI
46+
```
47+
48+
## Configuration
49+
50+
All configuration is done via environment variables. Key patterns:
51+
52+
- **Required variables**: `DOMAIN`, `DATABASE_PASSWORD`, `DATABASE_ROOT_PASSWORD`
53+
- **Ghost config pattern**: `section__subsection__key=value` (e.g., `mail__options__service=Mailgun`)
54+
- **Developer experiments**: Must set `labs__publicAPI=true` for analytics/ActivityPub features
55+
- **Data persistence**: Volumes stored in `./data/ghost` and `./data/mysql`
56+
57+
### Key configuration files:
58+
- `.env` - Main environment configuration (create from `.env.example`)
59+
- `compose.yml` - Docker Compose service definitions
60+
- `Caddyfile` - Reverse proxy routing configuration
61+
- `mysql-init/create-multiple-databases.sh` - MySQL multi-database initialization
62+
63+
## Migration from Ghost CLI
64+
65+
The repository includes comprehensive migration tools:
66+
67+
- `scripts/migrate.sh` - Main migration script that:
68+
- Backs up existing Ghost installation
69+
- Converts config.json to environment variables
70+
- Preserves content and database
71+
- Creates recovery script
72+
- Sets up Docker Compose environment
73+
74+
- `scripts/config-to-env.js` - Converts Ghost JSON config to .env format
75+
76+
## Development Workflow
77+
78+
1. Clone repository and copy `.env.example` to `.env`
79+
2. Configure required environment variables (domain, passwords)
80+
3. Enable developer experiments if using analytics/ActivityPub
81+
4. Run `docker compose up -d` to start services
82+
5. Access Ghost at `https://DOMAIN` (Caddy handles SSL automatically)
83+
6. Monitor logs with `docker compose logs -f ghost`
84+
85+
For analytics setup, see `TINYBIRD.md` for detailed instructions.
86+
87+
## Important Notes
2088

21-
The project uses Docker Compose to orchestrate Ghost and its dependencies (typically MySQL/MariaDB database). The main configuration is defined in `compose.yml`.
89+
- Ghost runs internally on port 2368; Caddy exposes it on 80/443
90+
- Email configuration is critical even without newsletter features (used for admin notifications)
91+
- MySQL health checks ensure database is ready before Ghost starts
92+
- The compose file uses yaml-language-server schema for IDE completion support
93+
- For production, always use strong passwords and consider additional security measures

0 commit comments

Comments
 (0)