Skip to content

Dockerizing Django with Postgres, Gunicorn, and Nginx

Notifications You must be signed in to change notification settings

akmamun/django-nginx-docker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Dockerizing Django with Postgres, Gunicorn, and Nginx

Instruction for Docker Deployment

Installation

Requirements:

  • Docker Latest

Follow these steps:

  • Make a file name .env
  • In.env file change SQL_HOST="db" or DB_HOST="db"
  • Make a file name .env.docker add for postgres
POSTGRES_USER=postgres
POSTGRES_PASSWORD=giveapassword
POSTGRES_DB=postgres

Up and Run

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