forked from bewiwi/DemoInstance
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10 from pmsipilot/vagrantfile
adding Vagrantfile
- Loading branch information
Showing
2 changed files
with
39 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# -*- mode: ruby -*- | ||
# vi: set ft=ruby : | ||
|
||
Vagrant.configure("2") do |config| | ||
config.vm.box_url = "https://atlas.hashicorp.com/ARTACK/boxes/debian-jessie" | ||
config.vm.box = "ARTACK/debian-jessie" | ||
|
||
config.vm.provider "virtualbox" do |vbox,override| | ||
vbox.customize ["modifyvm", :id, "--memory", 1024] | ||
vbox.customize ["modifyvm", :id, "--cpus", 1] | ||
override.vm.synced_folder ".", "/opt/demoinstance", :id => "vagrant-root", owner: "root", group: "root", :mount_options => ["dmode=777", "fmode=777"] | ||
end | ||
|
||
config.vm.usable_port_range = (2200..2299) | ||
config.vm.network "forwarded_port", guest: 8080, host: 2280, auto_correct: true | ||
config.vm.network "forwarded_port", guest: 8081, host: 2281, auto_correct: true | ||
|
||
config.vm.define :master do |master| | ||
master.vm.provision "shell" do |sh| | ||
sh.path = "ressources/vagrant_setup.sh" | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/bin/bash | ||
|
||
sudo apt-get install -y nginx python-pip supervisor python-dev libldap2-dev libsasl2-dev libmysqlclient-dev screen nodejs npm | ||
(cd /opt/demoinstance/backend && sudo python setup.py install) | ||
sudo cp /opt/demoinstance/ressources/supervisor_dev/*.conf /etc/supervisor/conf.d/ | ||
cp /opt/demoinstance/ressources/dev_demoinstance /opt/demoinstance/dev_demoinstance | ||
cp /opt/demoinstance/ressources/dev_demoinstance.py /opt/demoinstance/dev_demoinstance.py | ||
sudo /etc/init.d/nginx stop | ||
sudo /etc/init.d/supervisor stop | ||
sudo rm -f /var/run/supervisor.sock | ||
sudo rm -f /etc/nginx/sites-enabled/default | ||
sudo cp /opt/demoinstance/ressources/nginx/nginx-server /etc/nginx/sites-enabled/default | ||
sudo cp -R /opt/demoinstance/config /etc/demoinstance | ||
sudo ln -s /usr/bin/nodejs /usr/bin/node | ||
screen -S log -d -m sudo /usr/bin/supervisord -c /etc/supervisor/supervisord.conf | ||
|