Rails application development and deployment with docker.
Start the services:
$ docker-compose up -d
Create the database:
$ docker-compose run --rm web bin/rails db:create
Deploy the application via stack.yml
into a swarm cluster.
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
.
- dockerfiles/rails - Rails docker image based on alpine for development.