From 1c3046931a0f1cfe227e93768bacc282c3f7326e Mon Sep 17 00:00:00 2001 From: sebgl Date: Thu, 30 May 2019 10:52:09 +0200 Subject: [PATCH 1/4] Remove unnecessary directory creation --- Vagrantfile | 1 - 1 file changed, 1 deletion(-) diff --git a/Vagrantfile b/Vagrantfile index 68c385c..07d3c4a 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -2,7 +2,6 @@ $script = <<-SCRIPT apt-get update apt-get install git docker docker-compose -y git clone https://github.com/sebgl/htpc-download-box.git -mkdir /media chown -R vagrant:vagrant /media systemctl enable docker && systemctl start docker chown -R vagrant:vagrant htpc-download-box From 43c45f85a8b225c27dcc3e714462e265d6aa600b Mon Sep 17 00:00:00 2001 From: sebgl Date: Thu, 30 May 2019 10:52:59 +0200 Subject: [PATCH 2/4] Group related Vagrant commands together --- Vagrantfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Vagrantfile b/Vagrantfile index 07d3c4a..9dde6a9 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -1,9 +1,9 @@ $script = <<-SCRIPT apt-get update apt-get install git docker docker-compose -y -git clone https://github.com/sebgl/htpc-download-box.git -chown -R vagrant:vagrant /media systemctl enable docker && systemctl start docker +chown -R vagrant:vagrant /media +git clone https://github.com/sebgl/htpc-download-box.git chown -R vagrant:vagrant htpc-download-box cd htpc-download-box cp .env.example .env From 73c30692e21d8315b1f2ddc445db2a50cad42f24 Mon Sep 17 00:00:00 2001 From: sebgl Date: Thu, 30 May 2019 10:55:36 +0200 Subject: [PATCH 3/4] Setup a static IP to ease access to services --- Vagrantfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Vagrantfile b/Vagrantfile index 9dde6a9..8f925f0 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -13,5 +13,5 @@ SCRIPT Vagrant.configure("2") do |config| config.vm.box = "ubuntu/bionic64" config.vm.provision "shell", inline: $script - config.vm.network "private_network", type: "dhcp" + config.vm.network "private_network", ip: "192.168.7.7" end From df08ca27eb04d4648402f38ecc3edd7cd4e60b83 Mon Sep 17 00:00:00 2001 From: sebgl Date: Thu, 30 May 2019 10:57:01 +0200 Subject: [PATCH 4/4] Add details about Vagrant in the README --- README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/README.md b/README.md index 7d01f51..30a5bbe 100644 --- a/README.md +++ b/README.md @@ -182,6 +182,16 @@ This tutorial will guide you along the full process of making your own docker-co 2. Rename the `.env.example` file included in the repo to `.env`. 3. Continue this guide, and the docker-compose file snippets you see are already ready for you to use. You'll still need to manually configure your `.env` file and other manual configurations. +### (optional) Use premade Vagrant box + +You can also use a premade Vagrant box, that will spin up an Ubuntu virtual machine and bootstrap the environment from the `docker-compose` file described above. + +After ensuring Vagrant is installed on your machine: + +1. Run `vagrant up` to bootstrap the vagrant box +2. Run `vagrant ssh` to ssh into the box +3. Use the default `192.168.7.7` IP to access the box services from a local machine + ### Setup environment variables For each of these images, there is some unique coniguration that needs to be done. Instead of editing the docker-compose file to hardcode these values in, we'll instead put these values in a .env file. A .env file is a file for storing environment variables that can later be accessed in a general-purpose docker-compose.yml file, like the example one in this repository.