-
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
-
as our main django app service
depends-on
postgresql database service , we are implementing await_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.)