quantumtaskai-caprover/Dockerfile
thecyberlearn 5ec22c0487 Add Dokploy deployment configuration with Neon database
- 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
2025-09-06 10:18:24 +05:30

48 lines
1.2 KiB
Docker

# Use Python 3.11 slim image for better performance and smaller size
FROM python:3.11-slim
# Set environment variables
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1
ENV DEBIAN_FRONTEND=noninteractive
# Set work directory
WORKDIR /app
# Install system dependencies
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
postgresql-client \
gcc \
python3-dev \
libpq-dev \
curl \
&& rm -rf /var/lib/apt/lists/*
# Copy requirements first to leverage Docker cache
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Copy project files
COPY . .
# Create logs directory
RUN mkdir -p logs
# Collect static files
RUN python manage.py collectstatic --noinput --settings=netcop_hub.settings
# Create non-root user for security
RUN adduser --disabled-password --gecos '' appuser && chown -R appuser:appuser /app
USER appuser
# Health check
HEALTHCHECK --interval=30s --timeout=30s --start-period=5s --retries=3 \
CMD curl -f http://localhost:8000/health/ || exit 1
# Expose port
EXPOSE 8000
# Run gunicorn
CMD ["gunicorn", "--bind", "0.0.0.0:8000", "--workers", "2", "--timeout", "120", "--access-logfile", "-", "--error-logfile", "-", "netcop_hub.wsgi:application"]