- Install Docker for Mac. Also install Fabric via
pip install fabric==1.13.1
- Create .env file in repository root with the reference of
.env.example
or receive .env file from your team member. - Run
fab up
! - Go to http://127.0.0.1:8081/ to see the frontend / polymer running. The Django app is running under http://127.0.0.1:8082/api/
- As a separate terminal tab, run
fab fixtures
if this is first time running environment - load Site & ReportingEntity objects from fixture json files. - As a separate terminal tab, run
fab fake_data
to generate fake data like account, core, partner and other modules. There is alsofab real_data
command as well. - TEMP: Go to http://127.0.0.1:8081/api/admin/ login with admin/Passw0rd! and can now go to http://127.0.0.1:8082/app/ to see the frontend interface. Replace 'ip-reporting' or 'cluster-reporting' in the URL's to switch between the two interfaces.
- Install docker and docker-compose
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
sudo apt-get update -y
apt-cache policy docker-ce
sudo apt-get install -y docker-ce
sudo systemctl status docker
- Set ubuntu user to docker group
sudo usermod -aG docker ${USER}
# (Password will be prompt)
su - ${USER}
- Install pip and fabric 1.X
sudo apt-get install --assume-yes --reinstall ca-certificates
sudo apt-get install -y --no-install-recommends build-essential vim python-dev python-setuptools
sudo easy_install pip
sudo pip install --upgrade pip --trusted-host pypi.python.org
sudo pip install fabric==1.13.1 --trusted-host pypi.python.org
sudo curl -L https://github.com/docker/compose/releases/download/1.21.2/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
- Check docker-compose is installed
docker-compose --version
- Create .env file in repository root with the reference of
.env.example
or receive .env file from your team member. - Run
fab up
! - Go to http://127.0.0.1:8081/ to see the frontend / polymer running. The Django app is running under http://127.0.0.1:8082/api/
- As a separate terminal tab, run
fab fixtures
if this is first time running environment - load Site & ReportingEntity objects from fixture json files. - As a separate terminal tab, run
fab fake_data
to generate fake data like account, core, partner and other modules. There is alsofab real_data
command as well. - TEMP: Go to http://127.0.0.1:8082/api/admin/ login with admin/Passw0rd! and can now go to http://127.0.0.1:8082/app/ to see the frontend interface. Replace 'ip-reporting' or 'cluster-reporting' in the URL's to switch between the two interfaces.
Run migrations:
- ssh into backend container and run the commands below (using docker exec cmd or Docker Dasboard)
python /code/manage.py makemigrations --merge --noinput
python /code/manage.py migrate
Here are some docker tips:
- display all containers:
$ docker-compose ps
- ssh into running django_api container
$ fab ssh:django_api
- Stop all containers
$ fab stop
- Re-build docker images for containers
$ fab rebuild