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 [email protected]:xanthopoulakis/rails-on-docker.git
enter the folder
$ cd rails-on-docker
create the project
$ docker-compose run rails-service rails new . --api -T
build the project
$ docker-compose build rails-service
run the project
$ docker-compose up rails-service
run the rails console
$ docker-compose run rails-service rails c