This is an example of a Rails app that runs in a Docker container and is linked to a PostgreSQL database running in another container.
Both apps are used in the Hands on with Docker training class.
The PostgreSQL database's Dockerfile is at https://github.com/alvinlai/handson-postgres.