Skip to content

Instantly share code, notes, and snippets.

@eduardomp
Last active September 26, 2017 21:27
Show Gist options
  • Save eduardomp/819b9245dec69b156cf65d8b2355694f to your computer and use it in GitHub Desktop.
Save eduardomp/819b9245dec69b156cf65d8b2355694f to your computer and use it in GitHub Desktop.
Vagrantfile used for configuring development environment with nodejs and openalpr for experiment
Vagrant.configure(2) do |config|
config.vm.box = "ubuntu/trusty64"
config.vm.box_check_update = false
#exposing port 8080 to access from the host machine
config.vm.network "forwarded_port", guest: 8080, host: 8080 ,auto_correct: true
#development folder shared between host machine and this virtual machine
config.vm.synced_folder "./workspace", "/home/vagrant/workspace"
config.vm.provision "shell", inline: <<-SHELL
echo "### Adding requested repositories... ###"
sudo add-apt-repository -y ppa:mc3man/trusty-media
echo "### Update ubuntu packages... ###"
sudo apt-get update
sudo apt-get dist-upgrade
echo "### installing CURL... ###"
sudo apt-get install -y curl
echo "### installing GIT... ###"
sudo apt-get install -y git
echo "### installing NodeJS... ###"
wget "https://nodejs.org/dist/v6.11.3/node-v6.11.3-linux-x64.tar.xz"
sudo tar -C /usr/local --strip-components 1 -xf node-v6.11.3-linux-x64.tar.xz
echo "### removing unnecessary files ... ###"
sudo rm -rf node-v6.11.3-linux-x64.tar.xz
echo "### installing Docker... ###"
sudo apt-get -y install docker.io
sudo ln -sf /usr/bin/docker.io /usr/local/bin/docker
sudo sed -i '$acomplete -F _docker docker' /etc/bash_completion.d/docker
sudo update-rc.d docker defaults
echo "### Installing prerequisites for openalpr...###"
sudo apt-get install -y libopencv-dev libtesseract-dev make cmake build-essential libleptonica-dev
sudo apt-get install -y liblog4cplus-dev libcurl3-dev
sudo apt-get install -y beanstalkd
echo "### Installing openalpr...###"
git clone https://github.com/openalpr/openalpr.git
cd openalpr/src
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr -DCMAKE_INSTALL_SYSCONFDIR:PATH=/etc ..
make
sudo make install
echo "### installing FFmpeg... ###"
sudo apt-get install -y ffmpeg
echo "### Done! Use command 'vagrant ssh' to connect to this VM "
SHELL
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment