quantumtaskai-caprover/start-dokploy.sh
thecyberlearn a08cc04250 🔒 Fix HTTPS configuration for Dokploy deployment
HTTPS FIXES:
- Added TLS/SSL configuration to dokploy.json with Let's Encrypt
- Created production_https_settings.py with proper HTTPS Django settings
- Added SSL redirect, HSTS headers, and secure cookie settings
- Updated Dockerfile and startup script to use HTTPS settings
- Added CSRF trusted origins for both HTTP and HTTPS
- Configured Traefik proxy header handling

SECURITY IMPROVEMENTS:
- Force HTTPS redirect for production
- HTTP Strict Transport Security (HSTS) enabled
- Secure cookies (SESSION_COOKIE_SECURE, CSRF_COOKIE_SECURE)
- XSS protection and content type sniffing prevention
- Proper X-Forwarded-Proto header handling for Dokploy/Traefik

This should resolve HTTPS certificate and redirect issues in Dokploy.
2025-09-05 09:44:21 +05:30

36 lines
1.1 KiB
Bash
Executable File

#!/bin/bash
# Dokploy startup script
set -e # Exit on any error
echo "🚀 Starting Quantum Tasks AI on Dokploy"
echo "======================================="
# Run database migrations
echo "📄 Running database migrations..."
DJANGO_SETTINGS_MODULE=production_https_settings python manage.py migrate --noinput
# Create cache table if needed
echo "🗄️ Ensuring cache table exists..."
DJANGO_SETTINGS_MODULE=production_https_settings python manage.py createcachetable || true
# Check if we can access the database
echo "🔍 Testing database connection..."
DJANGO_SETTINGS_MODULE=production_https_settings python manage.py check --database default
# Start the application
echo "🌐 Starting gunicorn server on port 3000..."
echo "Health check endpoint: /health/"
echo "🔒 HTTPS enabled with SSL redirect"
echo "======================================="
DJANGO_SETTINGS_MODULE=production_https_settings exec gunicorn netcop_hub.wsgi:application
--bind 0.0.0.0:3000 \
--workers 2 \
--timeout 120 \
--max-requests 1000 \
--preload \
--log-level info \
--access-logfile - \
--error-logfile -