mikeantonelli / docker-rails-compose

Docker Rails example using React, docker-compose, and multi-stage builds.

Home Page:https://hub.docker.com/r/mikeantonelli/docker-rails-compose/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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:

  • Docker 17.05+
  • Docker Compose 1.12.0+

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/.

  • Debug Ruby - start debug service in the background.
  • Debug Chrome - start webpack service in the background, open Chrome.

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.

About

Docker Rails example using React, docker-compose, and multi-stage builds.

https://hub.docker.com/r/mikeantonelli/docker-rails-compose/


Languages

Language:HTML 74.6%Language:Ruby 21.3%Language:JavaScript 2.0%Language:CSS 0.8%Language:Shell 0.7%Language:Dockerfile 0.5%