Hey everyone,
I’m currently working on a task involving running my Rails (Movie) app through Vagrant using the Docker provider. Since I’m using a MacBook Air M1, installing VirtualBox is not feasible, so I opted for Docker. However, I’m encountering a port forwarding issue where connecting to localhost:3000 is not working.
Here are the steps I’ve taken:
- Initiated Vagrant with
vagrant init tknerr/baseimage-ubuntu-18.04
. - Executed
vagrant up --provider docker
. - Accessed Vagrant through
vagrant ssh
. - Updated packages with
sudo apt-get update
. - Installed Nginx, Ruby using rbenv, and PostgreSQL.
- Cloned a movie repository.
- Ran
bundle install
andbundle update
for required gems. - Successfully set up the container with a running PostgreSQL instance.
My Vagrant file is configured with:
config.vm.network "forwarded_port", guest: 3000, host: 3000
When I run curl localhost:80
, I can access the Rails app index page. However, attempting to connect via a browser using port 3000 is unsuccessful. I’ve also tried ports 80 and 8080, adjusting the Vagrant file accordingly, and executing vagrant reload
. Unfortunately, the issue persists.
I would greatly appreciate your guidance in resolving this port forwarding problem. Your quick response would be invaluable. Thanks