diff --git a/.env.dokploy.example b/.env.dokploy.example new file mode 100644 index 0000000..20d20bd --- /dev/null +++ b/.env.dokploy.example @@ -0,0 +1,24 @@ +# Required Environment Variables for Dokploy Deployment + +# Django Core +SECRET_KEY=your-secret-key-here-generate-a-new-one +DEBUG=false +ALLOWED_HOSTS=yourdomain.com,www.yourdomain.com + +# Database (PostgreSQL recommended for production) +DATABASE_URL=postgres://username:password@hostname:5432/database_name + +# Optional - Email Configuration +EMAIL_HOST_USER=your-email@gmail.com +EMAIL_HOST_PASSWORD=your-app-password + +# Optional - Stripe Payments +STRIPE_PUBLISHABLE_KEY=pk_test_your_stripe_publishable_key +STRIPE_SECRET_KEY=sk_test_your_stripe_secret_key +STRIPE_WEBHOOK_SECRET=whsec_your_webhook_secret + +# Optional - Static Files (for custom S3/CDN) +# AWS_ACCESS_KEY_ID=your-aws-access-key +# AWS_SECRET_ACCESS_KEY=your-aws-secret-key +# AWS_STORAGE_BUCKET_NAME=your-bucket-name +# AWS_S3_REGION_NAME=us-east-1 \ No newline at end of file diff --git a/Dockerfile.dokploy b/Dockerfile.dokploy new file mode 100644 index 0000000..08a67ea --- /dev/null +++ b/Dockerfile.dokploy @@ -0,0 +1,29 @@ +FROM python:3.11-slim + +WORKDIR /app + +# Install system dependencies +RUN apt-get update && apt-get install -y \ + gcc \ + libpq-dev \ + && rm -rf /var/lib/apt/lists/* + +# Copy and install Python dependencies +COPY requirements.txt . +RUN pip install --no-cache-dir -r requirements.txt + +# Copy application code +COPY . . + +# Set environment variables +ENV PYTHONUNBUFFERED=1 \ + SECRET_KEY="build-time-dummy-key-change-in-production" + +# Collect static files +RUN python manage.py collectstatic --noinput + +# Expose port 3000 for Dokploy +EXPOSE 3000 + +# Start gunicorn on port 3000 +CMD ["gunicorn", "netcop_hub.wsgi:application", "--bind", "0.0.0.0:3000"] \ No newline at end of file diff --git a/dokploy.json b/dokploy.json new file mode 100644 index 0000000..2a5be24 --- /dev/null +++ b/dokploy.json @@ -0,0 +1,10 @@ +{ + "name": "quantum-tasks-ai", + "type": "dockerfile", + "dockerfile": "./Dockerfile.dokploy", + "port": 3000, + "buildArgs": {}, + "env": { + "PYTHONUNBUFFERED": "1" + } +} \ No newline at end of file diff --git a/netcop_hub/settings.py b/netcop_hub/settings.py index 971d606..16b31c6 100644 --- a/netcop_hub/settings.py +++ b/netcop_hub/settings.py @@ -60,6 +60,10 @@ ALLOWED_HOSTS = config('ALLOWED_HOSTS', default='localhost,127.0.0.1,testserver, if config('CAPROVER_GIT_COMMIT_SHA', default=''): ALLOWED_HOSTS = ['*'] # Allow all hosts in CapRover environment +# Dokploy auto-detection +if config('DOKPLOY_PROJECT_NAME', default=''): + ALLOWED_HOSTS = ['*'] # Allow all hosts in Dokploy environment + # Site URL configuration for emails if config('RAILWAY_ENVIRONMENT', default=''): # Use production domain for email verification links