A flask, mongodb, docker project
Install:
- Python 3
- Pip
- Virtualenv
- Docker
Run the following commands:
sudo apt update
sudo apt install python3
sudo apt install python3-venv
sudo apt install python3-pip
Follow this guide.
And add yourself to a docker group, to circumvent the need of using sudo
. See this guide on how to do so.
Run the following command in a terminal:
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Run the following command:
brew install python3
Run the following commands:
brew install docker docker-machine
brew cask install virtualbox
-> need password
-> possibly need to address System Preference setting
docker-machine create --driver virtualbox default
docker-machine env default
eval "$(docker-machine env default)" # Used to set up any new terminal to connect to Docker daemon (may want to alias)
Set up the virtual environment
python3 -m venv venv
Then install requirements
pip3 install -r requirements.txt
Then start up the local environment and run main
source venv/bin/activate
python3 src/index.py
Then install requirements
pip3 install docker-compose
Build the docker image
docker-compose up