1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2024-11-28 09:24:24 +01:00

Include packages and copy configuration files to enable build and test Docker images in the virtual environment

This commit is contained in:
David O' Rojo 2019-09-25 14:08:15 -05:00
parent c7abd2519c
commit 5c791aa6d6
3 changed files with 41 additions and 2 deletions

12
Vagrantfile vendored
View File

@ -20,6 +20,9 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.network "forwarded_port", guest: port, host: port
end
# nginx server
config.vm.network "forwarded_port", guest: 80, host: 8080
# Configuration to allocate resources fro the virtual machine
config.vm.provider 'virtualbox' do |vb|
vb.customize ['modifyvm', :id, '--memory', '2048']
@ -30,9 +33,16 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.synced_folder '.', '/vagrant', type: 'virtualbox'
# Copy default configuration files for the database conenction and the Rails application
config.vm.provision "file", source: "./config/database.yml.default", destination: "/vagrant/config/database.yml"
config.vm.provision "file", source: "./config/database.yml.default", destination: "/vagrant/config/database.yml"
config.vm.provision "file", source: "./config/application.yml.default", destination: "/vagrant/config/application.yml"
# Copy default configuration files to allow reviewing the Docker Compose integration
config.vm.provision "file", source: "./docker/docker-compose.yml", destination: "/home/vagrant/docker-compose.yml"
config.vm.provision "file", source: "./docker/env.example", destination: "/home/vagrant/config/env"
config.vm.provision "file", source: "./docker/nginx.conf.example", destination: "/home/vagrant/config/nginx/fabmanager.conf"
config.vm.provision "file", source: "./docker/elasticsearch.yml", destination: "/home/vagrant/elasticsearch/config/elasticsearch.yml"
config.vm.provision "file", source: "./docker/log4j2.properties", destination: "/home/vagrant/elasticsearch/config/log4j2.properties"
## Provision software dependencies
config.vm.provision "shell", privileged: false, run: "once",
path: "provision/zsh_setup.sh"

View File

@ -165,6 +165,33 @@ install_ruby() {
rvm cleanup all
}
###
# Install Docker
docker()
{
echo "* Setting up Docker... *********************************************** "
sudo apt-get install -y curl \
ntp \
ntpdate \
ca-certificates \
apt-transport-https \
software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo apt-key fingerprint 0EBFCD88
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
sudo apt-get update
sudo apt-get install -y docker-ce
sudo usermod -a -G docker $USER
echo "* Setting up Docker Compose ****************************************** "
sudo curl -L https://github.com/docker/compose/releases/download/1.21.2/docker-compose-Linux-x86_64 -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
}
###
# Remove unused software
clean_up() {

View File

@ -30,4 +30,6 @@ setup() {
system_tuning
}
setup "$@"
setup "$@"
echo 'Virtual Environment is ready. Plase run `vagrant reload`.'