Rails application development and deployment with docker.
Start the services:
$ docker-compose up -dCreate the database:
$ docker-compose run --rm web bin/rails db:createDeploy the application via stack.yml into a swarm cluster.
or
deploy the services via the CLI
$ docker stack deploy -c stack.yml railsAfter 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:createMake 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.
