Skip to content

Demo web application to show how to work with containers

Notifications You must be signed in to change notification settings

Mikroways/demo-app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sample web application

This web application prints a default message (Hello world), but can be configured with an an environment variable. It's purpose is to show how an application responds to its configuration when working with containers.

Sample usage

In this case, application will use its defaults:

docker run --rm -it -p4567:4567 ghcr.io/mikroways/demo-app:latest

Now, you can check exposed services with:

curl 'http://localhost:4567/'
curl 'http://localhost:4567/env'
curl 'http://localhost:4567/request'

In any case, the use of jq can be useful to format output, for example: curl -s 'http://localhost:4567/env -s' | jq .

In this case, message is overriden with environment variable:

docker run --rm -it -e message="Hola mundo" -p4567:4567 ghcr.io/mikroways/demo-app:latest

Development

This image is created using sinatra and its code is only in app.rb. Requirements are managed with bundler using Gemfile.