- Add docker-compose.yml for Dokploy deployment - Add Dockerfile optimized for production - Add nginx.conf for SSL and reverse proxy - Update Django settings for ai.quantumtaskai.com domain - Add Neon database configuration - Add deployment guides and environment generators - Remove CapRover specific files
7.4 KiB
Complete Dokploy Configuration Guide
Hosting Quantum Tasks AI on ai.quantumtaskai.com
This guide walks you through the exact steps to configure your project in Dokploy.
🔧 Step 1: Access Dokploy Dashboard
-
Open your browser and navigate to your Dokploy dashboard:
https://your-dokploy-server.com -
Login with your Dokploy credentials
🆕 Step 2: Create New Project
-
Click "Create Project" or the "+" button in the dashboard
-
Choose Project Type:
- Select "Docker Compose" (this is important!)
- NOT "Application" or "Database" - we need Compose for multiple services
-
Project Configuration:
Project Name: quantumtasks-ai Description: Quantum Tasks AI Marketplace
📁 Step 3: Connect Git Repository
-
Repository Source: Choose "Git Repository"
-
Repository URL: Enter your repository URL:
https://github.com/your-username/quantumtaskai-caprover.git -
Branch: Set to
mainormaster(whatever your default branch is) -
Authentication (if private repo):
- Use Personal Access Token or SSH Key
- For GitHub: Settings → Developer settings → Personal access tokens
-
Build Path: Leave as
.(root directory)
🐳 Step 4: Docker Compose Configuration
-
Compose File Path: Set to
docker-compose.yml -
Build Context: Set to
.(root directory) -
Auto Deploy: Enable this for automatic deployments on git push
🌐 Step 5: Domain Configuration
-
Go to "Domains" tab in your project
-
Add Domain:
Domain: ai.quantumtaskai.com Port: 80 (nginx service will handle SSL) -
SSL Certificate:
- Enable "Generate SSL Certificate"
- Choose "Let's Encrypt"
- This will automatically handle HTTPS
⚙️ Step 6: Environment Variables
Go to "Environment" tab and add these variables:
🔑 Essential Variables (REQUIRED)
SECRET_KEY=your-django-secret-key-50-characters-minimum
DEBUG=false
ALLOWED_HOSTS=ai.quantumtaskai.com,*.quantumtaskai.com,quantumtaskai.com
CSRF_TRUSTED_ORIGINS=https://ai.quantumtaskai.com,https://quantumtaskai.com
🗄️ Neon Database Variable
NEON_DATABASE_URL=postgresql://your_username:your_password@your_endpoint.neon.tech/quantumtasks_ai?sslmode=require
📝 Get this from your Neon dashboard: Project → Dashboard → Connection Details → Connection String
📧 Email Configuration (Required for user accounts)
EMAIL_HOST_USER=your-email@gmail.com
EMAIL_HOST_PASSWORD=your-gmail-app-password
DEFAULT_FROM_EMAIL=Quantum Tasks AI <noreply@ai.quantumtaskai.com>
REQUIRE_EMAIL_VERIFICATION=true
💳 Payment Integration (Optional but recommended)
STRIPE_SECRET_KEY=sk_live_your_stripe_secret_key_here
STRIPE_WEBHOOK_SECRET=whsec_your_webhook_secret_here
🤖 AI API Keys (Optional but needed for AI features)
OPENAI_API_KEY=sk-your_openai_api_key_here
GROQ_API_KEY=gsk_your_groq_api_key_here
SERPAPI_API_KEY=your_serpapi_key_here
OPENWEATHER_API_KEY=your_weather_api_key_here
🔒 Security Settings
SECURE_SSL_REDIRECT=true
SECURE_PROXY_SSL_HEADER=HTTP_X_FORWARDED_PROTO,https
COMPOSE_PROJECT_NAME=quantumtasks-ai
🚀 Step 7: Deploy the Project
-
Review Configuration:
- ✅ Docker Compose file:
docker-compose.yml - ✅ Domain:
ai.quantumtaskai.com - ✅ Environment variables set
- ✅ SSL enabled
- ✅ Docker Compose file:
-
Click "Deploy" button
-
Monitor the Build Process:
- Watch the logs in real-time
- Build process will:
- Clone your repository
- Build the Docker image
- Start all services (nginx, web, db)
- Run health checks
-
Wait for "Healthy" Status:
- All services should show green/healthy status
- This may take 3-5 minutes
✅ Step 8: Post-Deployment Configuration
Initialize Database
Once deployment is complete, you need to set up the database:
-
Access Container Terminal in Dokploy:
- Go to your project → Services → web service
- Click "Terminal" or "Console"
-
Run Database Migrations:
python manage.py migrate -
Create Superuser:
python manage.py createsuperuser- Enter username, email, and password when prompted
-
Collect Static Files (if needed):
python manage.py collectstatic --noinput
🔍 Step 9: Verify Deployment
Test Your Application:
-
Health Check:
https://ai.quantumtaskai.com/health/Should return:
{"status": "healthy", ...} -
Main Website:
https://ai.quantumtaskai.com/Should load your marketplace
-
Admin Panel:
https://ai.quantumtaskai.com/admin/Login with your superuser credentials
-
Check HTTPS Redirect:
http://ai.quantumtaskai.com/Should automatically redirect to HTTPS
🔧 Step 10: Configure DNS (If Not Done)
If your domain isn't pointing to Dokploy server yet:
-
Get Your Server IP:
- From your Dokploy dashboard or server provider
-
Add DNS Record:
Type: A Name: ai Value: YOUR_DOKPLOY_SERVER_IP TTL: 300 (5 minutes) -
Wait for Propagation (can take up to 24 hours, usually 5-10 minutes)
📊 Monitoring & Logs
View Logs in Dokploy:
- Project Dashboard → Logs
- Individual Service Logs:
nginx: Web server logsweb: Django application logs
Check Service Health:
- All services should show "Healthy" status
- If any service is unhealthy, check its logs
🚨 Common Issues & Solutions
Issue 1: Build Fails
Solution:
- Check if all files are committed to git
- Verify
docker-compose.ymlis in repository root - Check environment variables are set
Issue 2: Domain Not Working
Solution:
- Verify DNS settings
- Check domain configuration in Dokploy
- Ensure SSL certificate generated successfully
Issue 3: Database Connection Error
Solution:
- Verify
NEON_DATABASE_URLis correctly formatted - Check Neon database is running (visit neon.tech dashboard)
- Ensure connection string includes
?sslmode=require - Test connection from Neon dashboard SQL editor
Issue 4: Static Files Not Loading
Solution:
- Run
python manage.py collectstatic --noinputin container - Check nginx service logs
- Verify volumes are properly mounted
🎯 Quick Checklist
Before deployment:
- Repository contains all required files
- Domain points to Dokploy server
- All environment variables configured
- Gmail app password created (for email)
- API keys obtained (OpenAI, Stripe, etc.)
After deployment:
- All services show "Healthy" status
- Database migrations completed
- Superuser account created
- Health check returns success
- Website loads correctly
- HTTPS redirect works
- Admin panel accessible
📞 Need Help?
If you encounter issues:
- Check Dokploy logs first
- Verify all environment variables are set correctly
- Test database connectivity from web container
- Check domain DNS propagation
- Review nginx configuration for any errors
Target URL: https://ai.quantumtaskai.com
Deployment Status: Ready to Deploy ✅
Your Quantum Tasks AI marketplace will be live and accessible once these steps are completed!