Skip to content

Commit 46f5600

Browse files
committed
new supported env vars RAILS_DEV_BOX_(RAM|CPUS)
1 parent fdd3bfa commit 46f5600

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,14 @@ Port 3000 in the host computer is forwarded to port 3000 in the virtual machine.
3333

3434
bin/rails server -b 0.0.0.0
3535

36+
## RAM and CPUs
37+
38+
By default, the VM launches with 2 GB of RAM and 2 CPUs.
39+
40+
These can be overridden by setting the environment variables `RAILS_DEV_BOX_RAM` and `RAILS_DEV_BOX_CPUS`, respectively. Settings on VM creation don't matter, the environment variables are checked each time the VM boots.
41+
42+
`RAILS_DEV_BOX_RAM` has to be expressed in megabytes, so configure 4096 if you want the VM to have 4 GB of RAM.
43+
3644
## What's In The Box
3745

3846
* Development tools

Vagrantfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Vagrant.configure('2') do |config|
1111
config.vm.provision :shell, path: 'bootstrap.sh', keep_color: true
1212

1313
config.vm.provider 'virtualbox' do |v|
14-
v.memory = 2048
15-
v.cpus = 2
14+
v.memory = ENV.fetch('RAILS_DEV_BOX_RAM', 2048).to_i
15+
v.cpus = ENV.fetch('RAILS_DEV_BOX_CPUS', 2).to_i
1616
end
1717
end

0 commit comments

Comments
 (0)