|
| 1 | +# Docker Deployment Guide |
| 2 | + |
| 3 | +## Quick Start with Docker |
| 4 | + |
| 5 | +### Prerequisites |
| 6 | +- Docker and Docker Compose installed |
| 7 | +- Git (to clone the repository) |
| 8 | + |
| 9 | +### Setup Steps |
| 10 | + |
| 11 | +1. **Clone the repository** (if not already done): |
| 12 | + ```bash |
| 13 | + git clone https://github.com/iLearn-Lab/NovelClaw.git |
| 14 | + cd NovelClaw |
| 15 | + ``` |
| 16 | + |
| 17 | +2. **Configure environment variables**: |
| 18 | + ```bash |
| 19 | + # Copy example env files to actual .env files |
| 20 | + cp .env.auth-portal.example apps/auth-portal/.env |
| 21 | + cp .env.multiagent.example apps/multiagent/.env |
| 22 | + cp .env.novelclaw.example apps/novelclaw/.env |
| 23 | + ``` |
| 24 | + |
| 25 | +3. **Edit the .env files** with your API keys: |
| 26 | + - `apps/novelclaw/.env` - Add your OpenAI/Anthropic API keys |
| 27 | + - `apps/multiagent/.env` - Add your OpenAI/Anthropic API keys |
| 28 | + - `apps/auth-portal/.env` - Change the SECRET_KEY |
| 29 | + |
| 30 | +4. **Build and start all services**: |
| 31 | + ```bash |
| 32 | + docker-compose up -d |
| 33 | + ``` |
| 34 | + |
| 35 | +5. **Access the application**: |
| 36 | + - Auth Portal: http://localhost:8010/select-mode |
| 37 | + - MultiAgent: http://localhost:8011/dashboard |
| 38 | + - NovelClaw: http://localhost:8012/dashboard |
| 39 | + |
| 40 | +### Docker Commands |
| 41 | + |
| 42 | +**Start services**: |
| 43 | +```bash |
| 44 | +docker-compose up -d |
| 45 | +``` |
| 46 | + |
| 47 | +**Stop services**: |
| 48 | +```bash |
| 49 | +docker-compose down |
| 50 | +``` |
| 51 | + |
| 52 | +**View logs**: |
| 53 | +```bash |
| 54 | +# All services |
| 55 | +docker-compose logs -f |
| 56 | + |
| 57 | +# Specific service |
| 58 | +docker-compose logs -f novelclaw |
| 59 | +docker-compose logs -f multiagent |
| 60 | +docker-compose logs -f auth-portal |
| 61 | +``` |
| 62 | + |
| 63 | +**Rebuild after code changes**: |
| 64 | +```bash |
| 65 | +docker-compose up -d --build |
| 66 | +``` |
| 67 | + |
| 68 | +**Restart a specific service**: |
| 69 | +```bash |
| 70 | +docker-compose restart novelclaw |
| 71 | +``` |
| 72 | + |
| 73 | +### Data Persistence |
| 74 | + |
| 75 | +The following directories are mounted as volumes to persist data: |
| 76 | +- `apps/auth-portal/local_web_portal/data` - Auth portal database |
| 77 | +- `apps/multiagent/local_web_portal/data` - MultiAgent data |
| 78 | +- `apps/novelclaw/local_web_portal/data` - NovelClaw database |
| 79 | +- `apps/novelclaw/local_web_portal/runs` - Writing runs and outputs |
| 80 | + |
| 81 | +### Troubleshooting |
| 82 | + |
| 83 | +**Port conflicts**: |
| 84 | +If ports 8010, 8011, or 8012 are already in use, edit `docker-compose.yml` to change the port mappings: |
| 85 | +```yaml |
| 86 | +ports: |
| 87 | + - "9010:8010" # Change 9010 to your preferred port |
| 88 | +``` |
| 89 | +
|
| 90 | +**Permission issues**: |
| 91 | +On Linux/Mac, you may need to adjust permissions: |
| 92 | +```bash |
| 93 | +chmod -R 755 apps/*/local_web_portal/data |
| 94 | +chmod -R 755 apps/novelclaw/local_web_portal/runs |
| 95 | +``` |
| 96 | + |
| 97 | +**View container status**: |
| 98 | +```bash |
| 99 | +docker-compose ps |
| 100 | +``` |
| 101 | + |
| 102 | +**Enter a container for debugging**: |
| 103 | +```bash |
| 104 | +docker exec -it novelclaw-workspace bash |
| 105 | +``` |
| 106 | + |
| 107 | +### Production Deployment |
| 108 | + |
| 109 | +For production deployment: |
| 110 | +1. Use proper secrets management (not .env files) |
| 111 | +2. Configure reverse proxy (nginx example in `infra/nginx/`) |
| 112 | +3. Set up SSL/TLS certificates |
| 113 | +4. Use external database instead of SQLite |
| 114 | +5. Configure proper backup for data volumes |
| 115 | +6. Set resource limits in docker-compose.yml |
| 116 | + |
| 117 | +See [DEPLOYMENT.md](DEPLOYMENT.md) for more production deployment details. |
0 commit comments