Django Celery Docker Example

screenshot of Django Celery Docker Example
django

Example Docker setup for a Django app behind an Nginx proxy with Celery workers

Overview

Setting up a Django application with Celery and Docker can seem daunting, but having a straightforward example like this one makes it much more approachable. This minimal example is designed to demonstrate how to create a Django app that runs behind an Nginx proxy, integrating Celery workers for background task processing. Although the repository is archived, its structure provides valuable insights for both beginners and seasoned developers looking to understand the orchestration of multiple services using Docker.

This setup highlights the importance of separating development and production environments while ensuring that your application runs efficiently. With Docker Compose, deploying complex configurations becomes significantly simpler, allowing for a seamless experience across different stages of development.

Features

  • Multi-Service Architecture: Defines five distinct services - app, postgres, rabbitmq, celery_beat, and celery_worker, aligning with Docker's philosophy of single responsibility for each service.

  • Development and Production Modes: Supports running the app in both development mode with Django’s built-in server and production mode using Gunicorn and Nginx for enhanced security and performance.

  • Docker Swarm Compatibility: Offers the capability to scale services using Docker Swarm, enabling inter-service communication across multiple hosts in a cluster environment.

  • Easy Configuration: Uses Docker Compose files to specify complex service configurations in a clear .yaml format, making it easy to manage dependencies between services.

  • Django-Centric Design: Focuses on the Django framework with best practices in mind, including reliance on a proxy to serve large files in production environments.

  • Quick Setup: Minimal setup instructions guide you through installing Docker and Docker Compose, allowing for a fast start without extensive configuration hurdles.

  • Outdated Yet Informative: Although the repository is archived, it still serves as a reference for foundational Docker concepts that can be applied in modern contexts.

django
Django

Django is a high-level Python web framework that encourages rapid development and clean, pragmatic design. It follows the model-view-controller (MVC) architectural pattern, providing an extensive set of built-in tools and conventions to streamline the creation of robust and scalable web applications.

fullstack
Fullstack

A fullstack boilerplate provides a starter application that includes both frontend and backend. It should include database, auth, payments, user roles and other backend services to build a fully featured saas or webapps.

docker
Docker

A website that uses Docker for containerization to streamline development, testing, and deployment workflows. This includes features such as containerization of dependencies, automated builds and deployments, and container orchestration to ensure scalability and availability.