Skip to content

giasuddin90/docker-djangorest-nginx-postgres-gunicorn

Repository files navigation

Docker-django-nginx-postgres-gunicorn boilerplate

This repository you can for any python django rest project. just add new app. We create this project by using django rest, postgresql, nginx and gunicorn

If you love this project give me a star,that will motivate me to create more.

Copy .env.example file to .env

|
|--> example.env
|--> .env

Make a file name .env.docker add

POSTGRES_USER=postgres
POSTGRES_PASSWORD=postgres
POSTGRES_DB=blog

Change your expected domain in nginx.conf file

Change Nginx Conf

 server_name www.example.com
 proxy_set_header Host www.example.com;

Docker Up and Run

  • Docker Build
docker-compose up -d --build
docker-compose exec web python manage.py migrate --noinput
docker-compose exec web python manage.py createsuperuser
  • Collect Statics
docker-compose exec web python manage.py collectstatic --no-input --clear
  • Check Logs
docker-compose logs -f
  • Container down
docker-compose down

We have mounted database media and static file

  • Docker List Volume Mount
docker volume ls
  • Docker Individual Volume
 docker inspect $name

About

Docker-django-nginx-postgres-gunicorn boilerplate

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published