I'd like to build a local environment, but can I use vagrant and virtualbox to build two environments: Rails and PHP?

Asked 2 years ago, Updated 2 years ago, 100 views

I'm a beginner engineer.

Tell me about building a local environment.
We are currently building Rails development environments (Rails, Ruby, PostgreSQL) using vagrant and virtualbox, but soon we will have PHP operations and we will need to build PHP development environments (PHP, MySQL, etc.).

What would you like to know
1. Wouldn't the environment of Rails be damaged if we built the PHP environment?(It's a messy image.)
2. Is it possible to create two development environments, Rails and PHP, within virtualbox using vagrant?

php ruby-on-rails ruby vagrant virtualbox

2022-09-30 16:14

1 Answers

Rails and PHP can live together within a single virtual machine (VM).
It doesn't matter if you use vagrant or not.

As no specific directory or project configuration is written, the general answer is as follows:

PHP and Rails are independent.Even if you deploy PHP in a typical way in an environment where Rails have been deployed, that won't break your existing Rails environment.

The vagrant itself simply imports and boots the image of the VM, and the deployment of the environment within the VM is controlled by the script called by the vagrant.
Rails and PHP can live together in a single VM as long as they correctly describe the script to be invoked (shell script or scripts such as chef and answerable).

Personally, I recommend that VMs for Rails and VMs for PHP be built separately, unless the requirement is that they both operate on the same server.


2022-09-30 16:14

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.