An intoduction to creating and running a Ruby on Rails service API on Docker. For a more comprehensive tutorial, feel free to take a look at the Docker docs.
- Make sure Docker is installed and running on your machine
- Use the IDE of you preference, such as Sublime Text or Visual Studio Code or Atom or RubyMine
If you are using Docker Machine, then docker-machine ip MACHINE_VM returns the Docker host IP address, to which you can append the port (:3000)
Open the command line console in your machine (or use Git Bash) and follow the steps below Checkout:
$ git clone git@github.com:xanthopoulakis/rails-on-docker.gitenter the folder
$ cd rails-on-dockercreate the project
$ docker-compose run rails-service rails new . --api -Tbuild the project
$ docker-compose build rails-servicerun the project
$ docker-compose up rails-servicerun the rails console
$ docker-compose run rails-service rails c