f-mer / docker-rails-example

πŸš€ Rails application development and deployment with docker.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

docker-rails-example

Rails application development and deployment with docker.

Development

Start the services:

$ docker-compose up -d

Create the database:

$ docker-compose run --rm web bin/rails db:create

Production

Deploy the application via stack.yml into a swarm cluster.

Try in PWD

or

deploy the services via the CLI

$ docker stack deploy -c stack.yml rails

After deploying the application with PWD or manually the database has to be created.

$ cname=$(docker ps --format '{{.Names}}' | grep 'web' | head -1)
$ docker exec $cname bin/rails db:create

Make sure everything works as expected by visiting the /heatlh endpoint and checking the container health via docker ps.

See also

About

πŸš€ Rails application development and deployment with docker.


Languages

Language:Ruby 76.8%Language:HTML 17.4%Language:JavaScript 3.6%Language:CSS 2.2%