Skip to content

Instantly share code, notes, and snippets.

@asolera
Last active April 12, 2021 14:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save asolera/deb5f342f8ac3c332abebcc6127b6cb9 to your computer and use it in GitHub Desktop.
Save asolera/deb5f342f8ac3c332abebcc6127b6cb9 to your computer and use it in GitHub Desktop.
Vagrant with dot env without plugins
EXAMPLE_ENV_A=Hello
EXAMPLE_ENV_B=world
#!/bin/bash
cd /home/myapp
export $(echo $(cat .env | sed 's/^#.*//g' | sed 's/\r//g' | xargs) | envsubst)
echo "Loaded env configs:"
echo $EXAMPLE_ENV_A
echo $EXAMPLE_ENV_B
Vagrant.configure("2") do |config|
config.vm.box = "ubuntu/xenial64"
config.vm.define "host" do |app|
app.vm.network "private_network", type: "dhcp"
app.vm.hostname = "host"
app.vm.synced_folder ".", "/home/myapp", type: "virtualbox"
app.vm.provider "virtualbox" do |v|
v.memory = 2048
v.cpus = 1
end
end
config.vm.provision "shell" do |s|
s.path = "bootstrap.sh"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment