Skip to content

nhatthaiquang-agilityio/docker-compose-django

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Django Development With Docker Compose and Machine

##Feature:

  • Docker
  • Docker Compose
  • Docker Machine
  • Python 2.7
  • Django 1.8.4
  • Postgres
  • Nginx
  • Redis
  • Gunicorn

Run command:

  • Start new machine:

     $docker-machine create -d virtualbox dev;
     $docker-machine start dev
    
  • Build images:

     $docker-compose build
    
  • Start services:

     $docker-compose up -d
    
  • Create database:

     $docker exec -it dockercomposedjango_postgres_1 bash
     $psql djangodocker --user postgres
    
  • Create migrations:

     $docker-compose run web /usr/local/bin/python /srv/web/manage.py migrate
    
  • Run Django App:

     $docker-compose run web python /srv/web/manage.py runserver 0.0.0.0:8000
    
  • Grab IP and view in your browser:

     $docker-machine ip dev`
    

Reference: