🌐
TestDriven.io
testdriven.io › blog › dockerizing-django-with-postgres-gunicorn-and-nginx
Dockerizing Django with Postgres, Gunicorn, and Nginx | TestDriven.io
July 27, 2023 - This tutorial details how to configure Django to run on Docker along with Postgres, Nginx, and Gunicorn.
🌐
DigitalOcean
digitalocean.com › community › tutorials › how-to-build-a-django-and-gunicorn-application-with-docker
How to Build a Django and Gunicorn Application with Docker | DigitalOcean
October 26, 2019 - You can see a diff of the changes you implemented in the polls-docker branch of the Polls app GitHub repository. This branch contains all the modifications described in this tutorial. From here, you can pair the Django/Gunicorn container with an Nginx reverse proxy container to handle and route ...
Discussions

Docker + Django + nginx + gunicorn
Guys, who can help set up Docker + Django + Gunicorn + Nginx? I get an error "/etc/nginx/html/index.html" is not found (2: No such file or directory) Or any other path My code on github More on forum.djangoproject.com
🌐 forum.djangoproject.com
0
0
October 16, 2022
Docker + django + gunicorn connect to Nginx of the host system - Stack Overflow
On ubuntu server 18.04 I run a docker container with Django 3.1 and Gunicorn which connects to a locally installed Postgres. I already have an another Django project with Nginx and Gunicorn on the ... More on stackoverflow.com
🌐 stackoverflow.com
Need advice on how to deploy to AWS Django with docker/gunicorn and Nginx?
It sounds like you're almost there. I set up a django app similarly recently. Not sure what your issue is with having the two images but it's the right approach. You'll want them both running on the same service in the same task definition with django exposing a port (eg. 8000) and nginx as a reverse proxy directing to this port on localhost. The thing you're definitely missing is a load balancer. Even if you're just going to have one task running at a time at the start, the IP will change every time a new task is spun up. It might also error if you try to access the IP directly when testing because you won't have the IP whitelisted in your ALLOWED_HOSTS. The solution is to setup a load balancer mapping from a domain to an open port on your nginx container. It's probably worth finding a guide just for this bit since it's a bit more generic. Another gotcha at this step is the load balancer will ping your service with health checks and if it doesn't respond ok it'll get restarted to try and bring it up again. This seems to cause issues - my solution was a health check middleware that check for pings on /health and returns HttpResponse("ok") but there's other approaches. Once it's all setup it's really robust but it was shocking for me how many gotchas were involved in the process. Most guides that I could find were terrible and incomplete... More on reddit.com
🌐 r/django
20
13
December 15, 2023
Awesome tutorial: Dockerizing Django with Postgres, Gunicorn, and Nginx
I used this tutorial as a base for a project I'm working on right now. I've added Selenium to the mix. The most helpful tutorial I've come across for Docker to help get a dev environment set up, plus production. There is other good content on that blog. More on reddit.com
🌐 r/django
8
62
February 18, 2022
🌐
Pluralsight
pluralsight.com › tech insights & how-to guides › tech guides & tutorials
Packaging a Django App Using Docker, NGINX, and Gunicorn | Pluralsight
This guide will explain how to set up up a Django app with Gunicorn as the WSGI and NGINX as the proxy server and packaging them using Docker.
🌐
Medium
adiramadhan17.medium.com › django-gunicorn-with-nginx-in-docker-21d32488ab98
Django Gunicorn with Nginx in Docker | by Adi Ramadhan | Medium
April 9, 2023 - OTHER CONCERN: Debug=False, STATIC and MEDIA Debug False is crucial for production env, STATIC and MEDIA should be served by nginx · Step 1: Django Myproject > Update myproject/myproject/settings.py
🌐
GitHub
github.com › mgnisia › Boilerplate-Docker-Django-Gunicorn-Nginx
GitHub - mgnisia/Boilerplate-Docker-Django-Gunicorn-Nginx: This repo contains a small example for a Django App in a Docker Container. For the deployment the docker-compose file uses Gunicorn and nginx. Based on the repo of Pawamoy (https://github.com/Pawamoy/docker-nginx-postgres-django-example).
This repo contains a small example for a Django App in a Docker Container. For the deployment the docker-compose file uses Gunicorn and nginx. Based on the repo of Pawamoy (https://github.com/Pawamoy/docker-nginx-postgres-django-example). - GitHub - mgnisia/Boilerplate-Docker-Django-Gunicorn-Nginx: ...
Starred by 84 users
Forked by 21 users
Languages   Dockerfile 100.0% | Dockerfile 100.0%
🌐
GitHub
github.com › testdrivenio › django-on-docker
GitHub - testdrivenio/django-on-docker: Dockerizing Django with Postgres, Gunicorn, and Nginx
Check out the tutorial. Uses the default Django development server. Rename .env.dev-sample to .env.dev. Update the environment variables in the docker-compose.yml and .env.dev files. ... Test it out at http://localhost:8000. The "app" folder is mounted into the container and your code changes apply automatically. Uses gunicorn + nginx.
Starred by 1.2K users
Forked by 454 users
Languages   Python 81.0% | Dockerfile 9.0% | Shell 5.7% | HTML 4.3% | Python 81.0% | Dockerfile 9.0% | Shell 5.7% | HTML 4.3%
🌐
Agiliq
agiliq.com › home › blog
Deploying Django app with Docker, Docker-Compose ... - Agiliq
November 3, 2025 - This tutorial demonstrates how to set up a Django app with a PostgreSQL database, reverse proxy with Nginx, SSL certificate management via Certbot, and an application server using Gunicorn.
🌐
GeeksforGeeks
geeksforgeeks.org › devops › how-to-dockerize-django-application-for-production-deployement-with-gunicorn-and-nginx
How to Dockerize django application for production deployment with Gunicorn and Nginx - GeeksforGeeks
July 23, 2025 - version: '3.9' # Defining the compose version services: # Nginx server nginx: # Build context build: ./nginx # Mapping machine and container ports ports: - 1337:80 # Storage volumes volumes: - static_volume:/home/app/web/staticfiles - media_volume:/home/app/web/mediafiles depends_on: - web restart: "on-failure" # Django application web: # Build context build: ./web # Build commands command: sh -c "python manage.py makemigrations && python manage.py migrate && python manage.py collectstatic && gunicorn web.wsgi:application --bind 0.0.0.0:8000" # Storage volumes volumes: - static_volume:/home/app/web/staticfiles - media_volume:/home/app/web/mediafiles # Exposing port 8000 expose: - 8000 restart: "on-failure" volumes: postgres_data: static_volume: media_volume:
Find elsewhere
🌐
Medium
medium.com › @nandagopal05 › deploy-django-project-with-nginx-gunicorn-docker-to-production-b4368a2fefff
Deploy Django project with Nginx, Gunicorn & Docker to production | by Nanda Gopal Pattanayak | Medium
June 20, 2024 - In this article, I’ll share the process I followed to get my Django project production-ready. Gunicorn handles the application server, Nginx acts as the reverse proxy, and Docker ensures consistent deployment.
🌐
DevGenius
blog.devgenius.io › dockerizing-django-application-gunicorn-and-nginx-5a74b250198f
Dockerizing Django Application — Gunicorn and Nginx | by Adesh Nalpet Adimurthy | Dev Genius
February 20, 2022 - Dockerizing Django Application — Gunicorn and Nginx A step-by-step tutorial on dockerizing a Django application with MySQL database using Guinicorn and Nginx. This post assumes that you have some …
🌐
Packtpub
subscription.packtpub.com › book › web-development › 9781838987428 › 1 › ch01lvl1sec18 › working-with-docker-containers-for-django-gunicorn-nginx-and-postgresql
Getting Started with Django 3.0 | Django 3 Web Development Cookbook
Working with Docker containers for Django, Gunicorn, Nginx, and PostgreSQL · Free Chapter · Models and Database Structure · Models and Database Structure · Introduction · Technical requirements · Using model mixins · Creating a model mixin with URL-related methods ·
🌐
Django Forum
forum.djangoproject.com › using django › deployment
Docker + Django + nginx + gunicorn - Deployment - Django Forum
October 16, 2022 - Guys, who can help set up Docker + Django + Gunicorn + Nginx? I get an error "/etc/nginx/html/index.html" is not found (2: No such file or directory) Or any other path My code on github
🌐
Coding for Entrepreneurs
codingforentrepreneurs.com › blog › django-gunicorn-nginx-docker
Django, Gunicorn, & NGINX Running together within a Container
November 18, 2022 - It was by design that nginx/default.conf is listening at port 80. To circumvent nginx you'd use the port mapping of -p 8000:8000 as port 8000 within the container is being handled by gunicorn.
🌐
Medium
medium.com › analytics-vidhya › setting-up-django-with-nginx-gunicorn-and-docker-352f7656f869
Setting up Django with Nginx, Gunicorn and Docker | by Harshvijaythakkar | Analytics Vidhya | Medium
April 18, 2020 - So to run Django in production is to run with Gunicorn and use Nginx as a reverse proxy so it gives more security to our application. The bin/gunicorn_start script is a shell script which creates one socket in run/ directory.
🌐
Packtpub
subscription.packtpub.com › book › web_development › 9781838987428 › 1 › ch01lvl1sec18 › working-with-docker-containers-for-django-gunicorn-nginx-and-postgresql
Working with Docker containers for Django, Gunicorn ...
Working with Docker containers for Django, Gunicorn, Nginx, and PostgreSQL · Free Chapter · Models and Database Structure · Models and Database Structure · Introduction · Technical requirements · Using model mixins · Creating a model mixin with URL-related methods ·
🌐
Stack Overflow
stackoverflow.com › questions › 64798838 › docker-django-gunicorn-connect-to-nginx-of-the-host-system
Docker + django + gunicorn connect to Nginx of the host system - Stack Overflow
I already have an another Django project with Nginx and Gunicorn on the same server without docker. The questions are: how to set up socket files for Gunicorn in a container and connect this container to the existing external Nginx so I can access the containerized django app from outside? ... version: '3' services: app: build: context: . ports: - "8001:8001" volumes: - ./app:/app env_file: - .env.prod command: > sh -c "gunicorn app.wsgi:application --bind 0.0.0.0:8001" ... https://www.digitalocean.com/community/tutorials/how-to-set-up-django-with-postgres-nginx-and-gunicorn-on-ubuntu-18-04
🌐
DigitalOcean
digitalocean.com › community › tutorials › how-to-scale-and-secure-a-django-application-with-docker-nginx-and-let-s-encrypt
How To Scale and Secure a Django Application with Docker, Nginx, and Let's Encrypt | DigitalOcean
July 10, 2020 - In addition, containers provide ... In this tutorial, you’ll horizontally scale a containerized Django and Gunicorn Polls application by provisioning two application servers that will each run a copy of a Django and Gunicorn app container....
🌐
Semaphore
semaphore.io › home › dockerizing a python django web application
Dockerizing a Python Django Web Application - Semaphore Tutorial
April 3, 2024 - Get an understanding of how to dockerize your Django application, using the Gunicorn web server, capable of serving thousands of requests in a minute.
🌐
GitHub
github.com › andrecp › django-tutorial-docker-nginx-postgres
GitHub - andrecp/django-tutorial-docker-nginx-postgres: Django tutorial running with Nginx, Gunicorn, PostgreSQL and docker-compose
July 20, 2015 - Django tutorial running with Nginx, Gunicorn, PostgreSQL and docker-compose - andrecp/django-tutorial-docker-nginx-postgres
Starred by 148 users
Forked by 28 users
Languages   JavaScript 57.0% | CSS 31.1% | Python 10.2% | JavaScript 57.0% | CSS 31.1% | Python 10.2%