How to simply deploy your Machine Learning models to production
These instructions will get you a copy of the code up and running on your local host for development and testing purposes. Deployment will focus on one platform of my choice.
Things you will need to bring the project up on your local machine
Docker (Not necessarily but advised)
Jupyter notebook
Python3
Text editor
A step by step series of getting a development env running on your local machine
mkdir Big4
cd Big4
virtualenv --no-site-packages venv
venv\Scripts\activate
git clone https://github.com/0x6f736f646f/MLDeploy.git
cd Big4Trendanalysis
mkdir Big4
cd Big4
virtualenv --no-site-packages venv
.venv/bin/activate
git clone https://github.com/0x6f736f646f/MLDeploy.git
cd Big4Trendanalysis
pip install -r requirements
python3 web.py
python3 api.py
docker build -t mldeploy:1.0 .
- -t is to tag the image being built
- mldepoly is the image name your can replace it with your own image name
- 1.0 is the version
docker run -d -p 4000:5000 big4trendanalysis:10.1 python3 web.py
- -d is running it as a daemon
- -p is for port mapping (We are mapping 5000 from docker container to 4000 to our localhost)
- mldeploy this is the image name we built
- 1.0 this is the version of the image we built
- python3 web.py this is passing a command to the container
docker run -d -p 4000:5000 big4trendanalysis:10.1 python3 web.py
- -d is running it as a daemon
- -p is for port mapping (We are mapping 5000 from docker container to 4000 to our localhost)
- mldeploy this is the image name we built
- 1.0 this is the version of the image we built
- python3 api.py this is passing a command to the container
Find your docker ip
docker-machine.exe ip
Then go to http:// docker-machine ip:4000
Go to http://localhost:4000 to find the web app or api
Procedure on how to deploy on heroku as a live system. I chose installation through the command line because it was easier for me than the web based view.
install heroku cli for windows and linux users
heroku login
heroku create --region eu your_appname # creates app in eu region, common regions: eu, us
heroku buildpacks:set heroku/python # set python buildpack
git push heroku master # deploy app to heroku
heroku logs --tail # If for some reason it’s not working, check the logs
Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.
This project is licensed under the MIT License - see the LICENSE.md file for details
- AI saturday Kenya