Featuring:
- Docker v1.10.3
- Docker Compose v1.6.2
- Docker Machine v0.6.0
- Python 3.5
Blog post -> https://realpython.com/blog/python/django-development-with-docker-compose-and-machine/
- Start the docker terminal
- Make sure you are signed in on your docker machine
- cd into your project
- Clone from a repo $ git clone "SSH Keys or HTTP"#
- cd ionto the project directory
- Pull the project to your docker machine - $ docker-compose pull
- Build the project - $ docker-compose build
- Run the project - $ docker-compose up -d
- Open your KITEMATIC
- Click "projectname_nginx_1" under CONTAINERS
- Click on the Settings Icon under Web Preview
- Click on the Published IP/Port under Configure Ports which will open the project on your default browser
- Start new machine -
docker-machine create -d virtualbox dev;
- Build images -
docker-compose build
- Start services -
docker-compose up -d
- Create migrations -
docker-compose run web /usr/local/bin/python manage.py migrate
- Grab IP -
docker-machine ip dev
- and view in your browser
In new terminal $ docker ps
copy container id for webapp image $ docker exec -t -i bash
$ cd <path/to/dangoapp> $ python3 manage.py makemigrations $ python manage.py migrate
$ python3 manage.py collectstatic
You have requested to collect static files at the destination location as specified in your settings:
/usr/src/app/static
This will overwrite existing files! Are you sure you want to do this?
type yes and press enter.
Ctrl + D to exit interactive bash