- Git
- Docker version 18.03.1-ce
- Docker-compose version 1.21.2
Install Docker (https://docs.docker.com/install/#server)
Install Docker-compose (https://docs.docker.com/compose/install/#prerequisites)
Clone repository.
Build containers (assuming your docker is installed as root):
cd CLONE_DIRECTORY
sudo docker-compose build
Run the following command:
sudo docker-compose up -d
Open postgresql
sudo docker-compose exec --user postgres appdb bash
psql
Change the password of postgres user and create database
ALTER USER postgres WITH PASSWORD 'db_pass';
CREATE DATABASE nqueens;
\q
exit
After this, whenever you want to run the application just execute from the root directory.
sudo docker-compose up -d
Create a new file called local_settings.py in nQueens/src/ and copy the information from the local_settings_template.py file into it.
Change the information corresponding to your local machine.
Type the following command
sudo docker-compose exec web bash
python nQueens.py
Or you can just type
sudo docker-compose exec web bash -c 'python nQueens.py'
sudo docker-compose exec web bash
python -m pytest tests.py
Or you can just type
sudo docker-compose exec web bash -c 'python -m pytest tests.py'