TLDR putting a rails app into docker
Install docker: http://docs.docker.com/mac/started/ This will also install the following things you'll need:
- Docker Machine for running the docker-machine binary
- Docker Engine for running the docker binary
- Docker Compose for running the docker-compose binary
- Kitematic, the Docker GUI a shell preconfigured for a Docker command-line environment
- Oracle VM VirtualBox
- Clone this repo
- cd into the repo
cd rails-docker
- Open the docker command line via the Docker Quickstart Terminal icon
- Run migrations via
docker-compose run web rake db:migrate
- Run
docker-compose up
to build and run the two containers (web and db) - Go to
http://localhost:3000
👀 - If localhost does not work, find your docker machine ip with
docker-machine ip default
- Go to
http://your_ip:3000
👀 (ex: http://192.168.99.100:3000/) - You can ensure your port number is 3000 by running docker ps and seeing the port number for the railsdocker_web image. If your port is not 3000, just change it to the one specified by docker ps
- You can also see which containers are running using docker ps