Skip to content

Hello Ruby

A minimal Sinatra web application in Ruby. One container, one service, no database, no cache.

Overview

Repository git@gitlab.com:appmecca-sample-apps/hello-ruby.git
Tech Stack Ruby 3.3 / Sinatra / Puma
Services web (port 4567)
Database None
Cache None
URL Pattern https://hello-ruby-web.{env}.appmecca.net

What This App Demonstrates

  • Deploying a Ruby application on AppMecca
  • Single-container deployment with Puma production server
  • Health check endpoint pattern
  • The three-step deploy process: register, build, deploy

appmecca.yaml

containers:
  - name: hello-ruby
    dockerfile: Dockerfile
    context: .

deploy:
  - name: web
    container: hello-ruby
    port: 4567
    health_check:
      path: /health

The configuration is identical in structure to any other single-container app. Sinatra with Puma listens on port 4567 by default.

Step-by-Step Deployment

1. Register the app

mecca register git@gitlab.com:appmecca-sample-apps/hello-ruby.git -e dev

2. Build the container

mecca build trigger -e dev -g git@gitlab.com:appmecca-sample-apps/hello-ruby.git
Expected output
Build started: build-xxxxxxxx
Cloning repository...
Building container: hello-ruby
Pushing image to the private registry: hello-ruby/web
Build complete. Duration: 38s

3. Deploy

mecca app deploy -e dev hello-ruby
Expected output
Deploying hello-ruby to dev...
Deployment queued: deploy-xxxxxxxx
Waiting for agents...
Container started: hello-ruby-web
Health check passed: /health -> 200 OK
Deployment complete.

Services:
  web: https://hello-ruby-web.dev.appmecca.net

4. Verify

mecca app show hello-ruby -e dev

Test the endpoint:

curl https://hello-ruby-web.dev.appmecca.net/health
{"status": "healthy"}

Key Concepts

Ruby web servers

Sinatra is a lightweight Ruby web framework. Puma is the production web server that handles concurrent requests. The combination is standard for Ruby microservices and API applications.

Port conventions

Sinatra defaults to port 4567. The port in appmecca.yaml must match whatever your application listens on. AppMecca handles HTTPS termination at the load balancer.

Any language, same workflow

AppMecca does not care what language your application is written in. As long as your container listens on the declared port and responds to health checks, the deployment workflow is identical.

What's Next?