Skip to content

sajeeshen/django_docker

Repository files navigation

Django Docker Deployment

Clone the repo to server and then run the following command

Development :

Run the migrations

docker-compose run app sh -c "python manage.py makemigrations core" docker-compose run app sh -c "python manage.py migrate" 

The for running serer

docker-compose up

One its done open your browser and go to

localhost:8000 you will see the site running

This will be using the docker-compose.yml file and doesnt use nginx , gumtree etc

Production

Migrations

docker-compose -f docker-compose.prod.yml run web python manage.py makemigrations core docker-compose -f docker-compose.prod.yml run web python manage.py migrate 

Build

docker-compose -f docker-compose.prod.yml up --build -d

For static files

docker-compose -f docker-compose.prod.yml run web python manage.py collectstatic --noinput

OR

docker exec DOCKERNAME /bin/sh -c "python manage.py collectstatic --noinput"

Once its done visit your website

About

Django Docker Deployment

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published