I would like any computer on the same network as my Mac to be able to access the dockerized Rails web app running on my Mac.
On my Mac (10.9.5) my Rails 4.2.4 web app is running fine in Docker when I access it via the docker ip and the port I assigned, 192.168.99.100:3000
Docker 1.8.1 is running under Virtualbox 5.0.2.
I'm using Docker-compose and the relevant part of the docker-compose.yml file is:
web:
build: .
command: 'bash -c ''bundle exec unicorn -p $PORT -c ./config/unicorn-local.rb'''
working_dir: /app/user
env_file:
- .docker_dev_env_config
- .docker_dev_env_personal
environment:
PORT: 3000
DATABASE_URL: 'postgres://postgres:@herokuPostgresql:5432/postgres'
ports:
- '3000:3000'
links:
- herokuPostgresql
and my Dockerfile is
FROM heroku-ruby2.0.0 # a local image based on heroku/ruby with ruby 2.0.0
EXPOSE 3000
ENV widget foo
My Mac's ip address on the local network is always set to 192.168.0.33.
How do I permit testers on the local network to access the running dockerized app via 192.168.0.33:3000 ?
(FWIW if I run my web app under Vagrant - instead of Docker - other testers on the network can access the web app by browsing 192.168.0.33:3000. My Vagrant is also running under Virtualbox. My Vagrantfile contains config.vm.network :forwarded_port, guest: 3000, host: 3000
but I do not see any equivalent for docker-compose.yml)