diff --git a/.gitignore b/.gitignore index 93bdeb85d1..04b43fe3af 100644 --- a/.gitignore +++ b/.gitignore @@ -30,3 +30,5 @@ unleash-server.tar.gz # idea stuff: *.iml + +.vagrant/ diff --git a/Dockerfile b/Dockerfile index bd07d5a3fa..807eb9afd3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,11 +1,14 @@ -FROM mhart/alpine-node:0.10.38 +FROM nodesource/trusty:0.12 COPY . . +RUN curl -sL http://cldup.com/XPw5-FrHJz.gz | \ + gunzip -c | tar -x -C /tmp/ && \ + mv /tmp/envconsul_0.5.0_linux_amd64/envconsul /usr/bin/ + RUN npm install --production && \ npm run build EXPOSE 4242 -ENTRYPOINT ["npm"] -CMD ["start"] +CMD envconsul -consul $(route -n | awk '/UG/ {print $2}'):8500 -prefix unleash node server.js \ No newline at end of file diff --git a/Vagrantfile b/Vagrantfile new file mode 100644 index 0000000000..1fccf7b811 --- /dev/null +++ b/Vagrantfile @@ -0,0 +1,20 @@ +# -*- mode: ruby -*- +# vi: set ft=ruby : + +# Vagrantfile API/syntax version. Don't touch unless you know what you're doing! +VAGRANTFILE_API_VERSION = "2" + +Vagrant.require_version ">= 1.7.0" + +Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| + config.vm.provider "virtualbox" do |v| + v.memory = 2048 + v.cpus = 2 + end + + config.vm.box = "boxcutter/ubuntu1410-docker" + + config.vm.network "private_network", ip: "192.168.12.34" + + config.vm.provision "shell", inline: "/vagrant/helpers/install.sh" +end \ No newline at end of file diff --git a/helpers/install.sh b/helpers/install.sh new file mode 100644 index 0000000000..dce90c55aa --- /dev/null +++ b/helpers/install.sh @@ -0,0 +1,14 @@ +#!/usr/bin/env bash + +set -e + +echo "" +sudo apt-get install unzip + +curl -L -O https://dl.bintray.com/mitchellh/consul/0.5.2_linux_amd64.zip + +unzip 0.5.2_linux_amd64.zip -d /usr/bin + +consul agent -data-dir=/tmp/consul -dc=oslo0 & +consul join dev-mod2.finntech.no +consul members \ No newline at end of file