Maintenance
Ongoing maintenance tasks for your PolitikTok deployment.
Updating PolitikTok
Docker Deployment
bash
# Pull latest image
docker compose -f docker-compose.prod.yml pull app
# Restart with new image
docker compose -f docker-compose.prod.yml up -d app
# Run any pending migrations
docker compose -f docker-compose.prod.yml exec app sqlx migrate runFrom Source
bash
git pull origin main
cargo build --release --features server
# Restart the serviceUpdating LLM Models
bash
docker compose exec ollama ollama pull llama3.1:8bLog Management
View Logs
bash
# All services
docker compose logs -f
# Specific service
docker compose logs -f app
# Last 100 lines
docker compose logs --tail=100 appLog Rotation
Docker automatically rotates logs. Configure limits in your compose file:
yaml
services:
app:
logging:
driver: json-file
options:
max-size: "10m"
max-file: "3"Health Checks
Service Status
bash
docker compose psDatabase Connection
bash
docker compose exec postgres pg_isready -U politiktokDisk Usage
bash
# Docker volumes
docker system df -v
# Overall disk
df -hTroubleshooting
Services Won't Start
bash
# Check logs for errors
docker compose logs app --tail=50
# Restart all services
docker compose down && docker compose up -dDatabase Migrations Failed
bash
# Check migration status
docker compose exec app sqlx migrate info
# Force run pending migrations
docker compose exec app sqlx migrate runOut of Disk Space
bash
# Clean unused Docker resources
docker system prune -a --volumes
# Remove old backups
find /opt/politiktok/backups -mtime +30 -deleteHigh Memory Usage
If Ollama is consuming too much memory, use a smaller model:
bash
docker compose exec ollama ollama pull llama3.2:3bUpdate LLM__MODEL=llama3.2:3b in your environment.