quantumtaskai-caprover/Dockerfile.dokploy.debug
thecyberlearn 01d3854194 Add comprehensive Django debug logging for 404 troubleshooting
- Container and port 3000 are working (simple HTTP server test passed)
- Issue is Django-specific routing, not Dokploy
- Added debug middleware to log all incoming requests
- Added debug_settings.py with enhanced logging and URL pattern display
- Updated Dockerfile.dokploy.debug to use debug settings
- Added proper ALLOWED_HOSTS with full domain
- This will show us exactly which requests Django receives and how it responds
2025-09-05 09:33:25 +05:30

58 lines
1.7 KiB
Docker

FROM python:3.11-slim
WORKDIR /app
# Install system dependencies
RUN apt-get update && apt-get install -y \
gcc \
libpq-dev \
curl \
&& 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 \
DEBUG=true \
SECRET_KEY="build-time-dummy-key-change-in-production" \
ALLOWED_HOSTS="*"
# Collect static files
RUN python manage.py collectstatic --noinput --settings=debug_settings || true
# Make startup script executable
RUN chmod +x start-dokploy.sh
# Expose port 3000 for Dokploy
EXPOSE 3000
# Debug: Print Django info
RUN python manage.py --version
RUN python manage.py check --settings=debug_settings || true
# Start with debug info
CMD echo "🐛 Debug Mode - Django $(python manage.py --version)" && \
echo "🔍 Environment:" && \
echo " - DEBUG: $DEBUG" && \
echo " - ALLOWED_HOSTS: $ALLOWED_HOSTS" && \
echo " - SECRET_KEY: $(echo $SECRET_KEY | cut -c1-10)..." && \
echo "🌐 Testing Django config..." && \
python manage.py check --settings=debug_settings && \
echo "✅ Django config OK" && \
echo "🧪 Testing URL patterns..." && \
python manage.py show_urls --settings=debug_settings || echo "show_urls not available" && \
echo "🚀 Starting server with detailed logging..." && \
DJANGO_SETTINGS_MODULE=debug_settings gunicorn netcop_hub.wsgi:application
--bind 0.0.0.0:3000 \
--workers 1 \
--timeout 120 \
--log-level debug \
--access-logfile - \
--error-logfile - \
--capture-output