From 8b7b64bb09fee1ba2fea03bb94ad7822667b0298 Mon Sep 17 00:00:00 2001 From: Someone Date: Wed, 4 Dec 2019 17:59:19 +0100 Subject: [PATCH] Vagrant provisioning --- Vagrantfile | 20 ++++++++++++++++++++ vagrant_provision.sh | 25 +++++++++++++++++++++++++ 2 files changed, 45 insertions(+) create mode 100644 Vagrantfile create mode 100755 vagrant_provision.sh diff --git a/Vagrantfile b/Vagrantfile new file mode 100644 index 0000000..3bcfced --- /dev/null +++ b/Vagrantfile @@ -0,0 +1,20 @@ +Vagrant.configure("2") do |config| + config.vm.box = "debian/buster64" + + config.vm.provider "virtualbox" do |v| + v.name = "mm-dev-env" + v.memory = 4096 + end + + config.vm.provider "libvirt" do |v| + v.memory = 4096 + + config.vm.synced_folder ".", "/vagrant", type: "rsync" + end + + # design-choice: run file in vm. + config.vm.provision "shell", inline: "/vagrant/vagrant_provision.sh" + + config.vm.network "forwarded_port", adapter: 1, guest: 8065, host: 8065 + +end diff --git a/vagrant_provision.sh b/vagrant_provision.sh new file mode 100755 index 0000000..1e3f43a --- /dev/null +++ b/vagrant_provision.sh @@ -0,0 +1,25 @@ +#!/bin/bash + +cd /vagrant +apt update +apt install -y build-essential curl vim docker-compose docker.io +apt purge -y apparmor +rm -rf /usr/local/go +wget https://dl.google.com/go/go1.13.3.linux-amd64.tar.gz +tar -C /usr/local -xzf go1.13.3.linux-amd64.tar.gz + + +usermod -aG docker vagrant +echo 'export PATH="/usr/local/go/bin:$PATH"' >> /root/.bashrc +echo 'export PATH="/usr/local/go/bin:$PATH"' >> /etc/profile +. /etc/profile + + +curl -sL https://deb.nodesource.com/setup_13.x | bash - +curl -sL https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add - +echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list +apt-get install -y nodejs yarn +npm install -g webpack webpack-cli webpack-dev-server copy-webpack-plugin +npm install --save-dev webpack webpack-cli webpack-dev-server copy-webpack-plugin +npm install webpack webpack-cli webpack-dev-server copy-webpack-plugin + -- 2.43.0