Skip to content

Instantly share code, notes, and snippets.

@asolera

asolera/.env

Last active Apr 12, 2021
Embed
What would you like to do?
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