Notes on setting up a boilerplate vagrant, docker, django, postgres project using cookiecutter-django
vagrant box add williamyeh/ubuntu-trusty64-docker
(Thanks William Yeh)
mkdir whatever; cd whatever
vagrant init williamyeh/ubuntu-trusty64-docker
vagrant up
vagrant ssh
cd /vagrant
sudo apt-get update
sudo apt-get install python3-pip
sudo pip3 install "cookiecutter>=1.4.0"
mkdir dev; cd dev
cookiecutter https://github.com/pydanny/cookiecutter-django
docker-compose -f dev.yml build
export COMPOSE_FILE=dev.yml
docker-compose up -d
docker ps
sudo apt-get install software-properties-common python-software-properties
sudo add-apt-repository "deb http://apt.postgresql.org/pub/repos/apt/ trusty-pgdg main"
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
sudo apt-get update
sudo apt-get install postgresql-client-9.6
docker exec -it <your postgres container id> bash
psql -U postgres
\l
psql demoz postgres
psql -h 172.18.0.2 -p 5432 -U postgres -d demoz
config.vm.network "forwarded_port", guest: 80, host: 8080
config.vm.network "forwarded_port", guest: 8000, host: 8000
ALLOWED_HOSTS = ['localhost', '127.0.0.1']
INTERNAL_IPS = ['localhost','127.0.0.1', '10.0.2.2', ]