Skip to content

Commit

Permalink
Merge pull request sebgl#21 from sebgl/small-vagrant-improvements
Browse files Browse the repository at this point in the history
This his builds on top of sebgl#20 to fix a few things in the Vagrantfile, add a static IP, and add some doc in the README.
  • Loading branch information
sebgl authored Jun 11, 2019
2 parents bdd19cc + df08ca2 commit 423e39c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
7 changes: 3 additions & 4 deletions Vagrantfile
Original file line number Diff line number Diff line change
@@ -1,10 +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
mkdir /media
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
Expand All @@ -14,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

0 comments on commit 423e39c

Please sign in to comment.