Skip to content

huychau/django-postgres-nginx-docker-compose

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Django + Postgres + Nginx + Gunicorn + Docker Compose

Dockerizing Django with Postgres, Gunicorn, and Nginx

Stacks

  • Django
  • PostgreSQL
  • Nginx
  • Gunicorn

Targets:

Create docker-compose file(s) that satifies the following requirements:

  • Compose up a Django app with PostgreSQL as database.
  • Serve API via Nginx proxy.
  • Have a service to migrate/init data from Django app.
  • Have a service to test your Django app.
  • Auto-reload Django app whenever a change is made from backend code.
  • Persistence the database.

How to build

  • Set environtment mode
    • dev: running development server
    • test: running unittest and test coverage
export ENV=dev|test
  • Run
docker-compose run
  • Load dump data
docker exec -it web ./manage.py loaddata data.json
  • Collect static files
docker exec -it web ./manage.py collectstatic --noinput

Open on browser

About

Dockerizing Django with Postgres, Gunicorn, and Nginx

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published