lyteabovenyte / deploy-django-with-docker-compose-and-AWS

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Django deployment using Docker-compose and AWS


services used in this project:

  • Docker

    • Creating an image for our app and run the services using docker-compose
  • Django

    • configurin a django app to configure and interact with our database (in this case postgresql ) and reverse proxy ( in this specific case NGINX )
  • NGINX

    • used as reverse proxy to map our media and static urls to the right volume and other urls to uWSGI service
  • Postgresql

    • run postgresql image as container to depends on our main django app container
    • configure Postgresql as the default database engine and interact with it through app container using docker-compose

some of the key features of this simulation

  • as our main django app service depends-on postgresql database service , we are implementing a wait_for_db command to check whether the database is ready or not before running our django app service

  • as we are simulating production ready terms, it's better to set environment variable in our main django app and fed those variables from our docker-compoes file while running our services where we have access to any other services such as Nginx, postgresql, ...

  • it's always the best practice to use virtuall environment on our app image to exclude our app depencencies from our base image dependencies (btw we are using python base image which is base on apline. a lightweight image that has few denependency.)

About


Languages

Language:Python 91.3%Language:Dockerfile 8.7%