Skip to content
A simple Ruby application with a Dockerfile to showcase Dockerfile best practices
Dockerfile Ruby
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
dockerfiles
.dockerignore
.gitignore
Dockerfile
Gemfile
Gemfile.lock
README.md
config.ru
test.rb

README.md

ruby-dockerfile-example

See https://lipanski.github.io/posts/dockerfile-ruby-best-practices.

A simple Ruby application with a Dockerfile to showcase Dockerfile best practices.

When passed a URL via the url query parameter, the application will parse and return the title of the underlying web page.

Usage: Standalone

Install dependencies:

bundle install

Run the server:

bundle exec rackup

Place a request:

curl "http://localhost:3000/?url=google.com"

Usage: Docker

Build the image:

docker build --build-arg GITHUB_TOKEN=xxx -t my-docker-image:v1 .

Run the server inside a container:

docker run -it --rm -p 3000:3000 my-docker-image:v1

Place a request:

curl "http://localhost:3000/?url=google.com"
You can’t perform that action at this time.