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¶
2. Build the container¶
Expected output
3. Deploy¶
Expected output
4. Verify¶
Test the endpoint:
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?¶
- Hello Flask -- see the same pattern in Python
- Go Web Server -- see the same pattern in Go
- Hello Java -- see the same pattern in Java
- App with Database -- add PostgreSQL to your application