docs: Update README with Docker deployment info
This commit is contained in:
parent
0b258aef4e
commit
208dfdb7fa
128
README.md
128
README.md
@ -244,21 +244,125 @@ DATABASE_URL="file:./dev.db"
|
|||||||
|
|
||||||
## 🚀 Deployment
|
## 🚀 Deployment
|
||||||
|
|
||||||
### Vercel (Recommended)
|
### 🐳 Docker Deployment (Recommended for Proxmox)
|
||||||
|
|
||||||
|
Keep Notes includes complete Docker configuration for easy deployment on Proxmox or any Docker host.
|
||||||
|
|
||||||
|
#### Quick Start
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
npm run build
|
cd keep-notes
|
||||||
# Deploy to Vercel
|
|
||||||
|
# Create environment file
|
||||||
|
cat > .env << EOF
|
||||||
|
NEXTAUTH_URL=http://localhost:3000
|
||||||
|
NEXTAUTH_SECRET=$(openssl rand -base64 32)
|
||||||
|
EOF
|
||||||
|
|
||||||
|
# Build and start
|
||||||
|
docker-compose build
|
||||||
|
docker-compose up -d
|
||||||
|
|
||||||
|
# Access at http://localhost:3000
|
||||||
```
|
```
|
||||||
|
|
||||||
### Docker
|
#### Deployment Script
|
||||||
```dockerfile
|
|
||||||
FROM node:20-alpine
|
We provide an automation script for common tasks:
|
||||||
WORKDIR /app
|
|
||||||
COPY . .
|
```bash
|
||||||
RUN npm install
|
chmod +x deploy.sh
|
||||||
RUN npx prisma generate
|
|
||||||
RUN npm run build
|
# Build image
|
||||||
CMD ["npm", "start"]
|
./deploy.sh build
|
||||||
|
|
||||||
|
# Start containers
|
||||||
|
./deploy.sh start
|
||||||
|
|
||||||
|
# View logs
|
||||||
|
./deploy.sh logs
|
||||||
|
|
||||||
|
# Backup database
|
||||||
|
./deploy.sh backup
|
||||||
|
|
||||||
|
# Update application
|
||||||
|
./deploy.sh update
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Features
|
||||||
|
|
||||||
|
- ✅ **Multi-stage Docker build** for optimized image size
|
||||||
|
- ✅ **Persistent volumes** for database and uploads
|
||||||
|
- ✅ **Health checks** for automatic restart
|
||||||
|
- ✅ **Resource limits** for stable performance
|
||||||
|
- ✅ **Ollama support** for local AI models (optional)
|
||||||
|
- ✅ **Nginx reverse proxy** configuration included
|
||||||
|
- ✅ **Automated backups** with cron scripts
|
||||||
|
|
||||||
|
#### Architecture
|
||||||
|
|
||||||
|
```
|
||||||
|
keep-notes/
|
||||||
|
├── Dockerfile # Multi-stage build
|
||||||
|
├── docker-compose.yml # Container orchestration
|
||||||
|
├── .dockerignore # Build optimization
|
||||||
|
├── deploy.sh # Deployment automation
|
||||||
|
└── DOCKER_DEPLOYMENT.md # Complete guide
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Supported Platforms
|
||||||
|
|
||||||
|
- **Proxmox VE** (LXC containers or VMs)
|
||||||
|
- **Docker hosts** (Linux, Windows, macOS)
|
||||||
|
- **Cloud providers** (AWS, GCP, Azure)
|
||||||
|
- **Kubernetes** (via Docker Compose)
|
||||||
|
|
||||||
|
#### AI Features Setup
|
||||||
|
|
||||||
|
**Option 1: OpenAI (Cloud)**
|
||||||
|
```yaml
|
||||||
|
# In .env or docker-compose.yml
|
||||||
|
OPENAI_API_KEY=sk-your-key-here
|
||||||
|
```
|
||||||
|
|
||||||
|
**Option 2: Ollama (Local AI)**
|
||||||
|
```bash
|
||||||
|
# Uncomment ollama service in docker-compose.yml
|
||||||
|
./deploy.sh start
|
||||||
|
./deploy.sh ollama-pull granite4
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Documentation
|
||||||
|
|
||||||
|
See [DOCKER_DEPLOYMENT.md](keep-notes/DOCKER_DEPLOYMENT.md) for:
|
||||||
|
- Complete Proxmox deployment guide
|
||||||
|
- SSL/HTTPS configuration with Let's Encrypt
|
||||||
|
- Database backup and restore procedures
|
||||||
|
- Performance tuning and resource recommendations
|
||||||
|
- Troubleshooting common issues
|
||||||
|
- Security best practices
|
||||||
|
|
||||||
|
### ☁️ Vercel (Alternative)
|
||||||
|
|
||||||
|
For serverless deployment:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cd keep-notes
|
||||||
|
npm run build
|
||||||
|
vercel deploy
|
||||||
|
```
|
||||||
|
|
||||||
|
### 📦 Traditional Deployment
|
||||||
|
|
||||||
|
For traditional VPS or bare metal:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cd keep-notes
|
||||||
|
npm install
|
||||||
|
npx prisma generate
|
||||||
|
npx prisma migrate deploy
|
||||||
|
npm run build
|
||||||
|
npm start
|
||||||
```
|
```
|
||||||
|
|
||||||
## 📝 Development Notes
|
## 📝 Development Notes
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user