mirror of
https://github.com/thecyberlearn/modern-django-starter.git
synced 2026-08-18 09:52:56 +00:00
✨ Features: - Complete Django project with authentication - Email/password and social login (Google, Facebook) - Role-based access control (admin, staff, user) - Docker and Docker Compose setup - Production-ready configuration - Static file handling with WhiteNoise - PostgreSQL database integration - Comprehensive documentation - GitHub CI/CD workflows - Dokploy deployment configuration 🚀 Ready for deployment on Dokploy, Heroku, Railway, and other platforms
44 lines
993 B
Docker
44 lines
993 B
Docker
FROM python:3.11-slim as base
|
|
|
|
ENV PYTHONDONTWRITEBYTECODE=1
|
|
ENV PYTHONUNBUFFERED=1
|
|
|
|
RUN apt-get update \
|
|
&& apt-get install -y --no-install-recommends \
|
|
postgresql-client \
|
|
build-essential \
|
|
libpq-dev \
|
|
gettext \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
WORKDIR /app
|
|
|
|
COPY requirements/base.txt /app/requirements/
|
|
RUN pip install --no-cache-dir -r requirements/base.txt
|
|
|
|
FROM base as development
|
|
|
|
COPY requirements/development.txt /app/requirements/
|
|
RUN pip install --no-cache-dir -r requirements/development.txt
|
|
|
|
COPY . /app/
|
|
|
|
EXPOSE 8000
|
|
|
|
CMD ["python", "manage.py", "runserver", "0.0.0.0:8000"]
|
|
|
|
FROM base as production
|
|
|
|
COPY requirements/production.txt /app/requirements/
|
|
RUN pip install --no-cache-dir -r requirements/production.txt
|
|
|
|
RUN groupadd -r django && useradd -r -g django django
|
|
|
|
COPY . /app/
|
|
|
|
RUN chown -R django:django /app
|
|
USER django
|
|
|
|
EXPOSE 8000
|
|
|
|
CMD ["gunicorn", "--bind", "0.0.0.0:8000", "--workers", "3", "django_project.wsgi:application"] |