# VoxBlog Quick Start Guide ## 🚀 Deploy to Production in 5 Minutes ### Prerequisites - VPS with Docker and Docker Compose installed - Gitea repository set up - Domain name (optional, for SSL) ### Step 1: Clone Repository on VPS ```bash ssh user@your-vps # Navigate to your deployment directory cd /var/www # or /home/user/apps # Clone from Gitea git clone https://your-gitea-url/username/voxblog.git cd voxblog ``` ### Step 2: Configure Environment ```bash # Copy example env file cp .env.example .env # Edit with your values nano .env ``` Fill in all values: - `MYSQL_ROOT_PASSWORD` - Strong password for MySQL root - `MYSQL_PASSWORD` - Password for voxblog database user - `ADMIN_PASSWORD` - Password for admin login - `OPENAI_API_KEY` - Your OpenAI API key - `GHOST_ADMIN_API_KEY` - Your Ghost CMS API key - `S3_*` - Your S3 credentials - `VITE_API_URL` - Your API URL (e.g., https://api.yourdomain.com) ### Step 3: Deploy ```bash # Make deploy script executable chmod +x deploy.sh # Run deployment ./deploy.sh ``` That's it! Your application is now running: - **API**: http://your-vps:3301 - **Admin**: http://your-vps:3300 ### Step 4: Set Up CI/CD (Choose One) #### Option A: Gitea Actions (Recommended) 1. **Install Gitea Runner on VPS:** ```bash # Download runner wget https://dl.gitea.com/act_runner/latest/act_runner-latest-linux-amd64 chmod +x act_runner-latest-linux-amd64 sudo mv act_runner-latest-linux-amd64 /usr/local/bin/act_runner # Register (get token from Gitea: Settings → Actions → Runners) act_runner register \ --instance https://your-gitea-url \ --token YOUR_RUNNER_TOKEN \ --name voxblog-runner # Create systemd service sudo tee /etc/systemd/system/gitea-runner.service > /dev/null < /dev/null < /dev/null < backup-$(date +%Y%m%d).sql # Restore backup docker-compose exec -T mysql mysql -u voxblog -p voxblog < backup-20241025.sql ``` ### Full Backup ```bash # Backup data directory tar -czf voxblog-data-$(date +%Y%m%d).tar.gz data/ # Backup database docker-compose exec mysql mysqldump -u voxblog -p voxblog > db-backup-$(date +%Y%m%d).sql ``` ## 🔐 Security Checklist - [ ] Strong passwords in `.env` - [ ] Firewall enabled (ufw) - [ ] SSH key-based authentication - [ ] SSL/TLS enabled (HTTPS) - [ ] Regular backups configured - [ ] Docker updated regularly - [ ] Monitor logs for suspicious activity ## 🎯 Production Checklist - [ ] `.env` file configured with production values - [ ] Domain name pointed to VPS - [ ] SSL certificate installed - [ ] Nginx reverse proxy configured - [ ] Gitea Actions/Webhook set up - [ ] Secrets added to Gitea - [ ] Backup strategy in place - [ ] Monitoring set up - [ ] Firewall configured - [ ] Test deployment successful ## 📚 Additional Resources - [Full Deployment Guide](DEPLOYMENT_GUIDE.md) - [Docker Compose Docs](https://docs.docker.com/compose/) - [Gitea Actions Docs](https://docs.gitea.io/en-us/actions/) - [Nginx Docs](https://nginx.org/en/docs/) --- **Need help?** Check the logs first: `docker-compose logs -f`