mikeantonelli / docker-rails-compose

Docker Rails example using React, docker-compose, and multi-stage builds.
https://hub.docker.com/r/mikeantonelli/docker-rails-compose/
9 stars 1 forks source link

docker-rails-compose

This project aims to provide an example of how to utilize Docker to build a Ruby on Rails application.

Requirements

This documentation is being written with:

Usage

Pull an Existing Docker Image

➭ docker-compose pull app

Build a new Docker Image

➭ docker-compose build app

There is also a convenience script in hooks/ that is used by Docker Cloud, and you can use it too:

➭ ./hooks/build

Run the Application

➭ docker-compose up app

The container will expose port 3000 on the host machine - to see the port mapping use the command below.

➭ docker ps
CONTAINER ID        IMAGE                                      COMMAND                  CREATED             STATUS              PORTS                     NAMES
d17a963767a8        mikeantonelli/docker-rails-compose:0.1.0   "bin/rails s -b 0.0.…"   11 seconds ago      Up 14 seconds       0.0.0.0:32777->3000/tcp   docker-rails-compose_app_1

In the above example, the application will be available at http://localhost:32777.

Run Tests

➭ docker-compose run test

There is also a convenience script in hooks/ that is used by Docker Cloud, and you can use it too:

➭ ./hooks/test

Developing

Visual Studio Code configuration is provided in .vscode/.

Contributing

Please feel free to log an issue or propose changes to this project. I hope that you find it helpful and would like to keep it relevant.