Ruby + Sidekiq Workers¶
Ruby/Sinatra API with Sidekiq for background job processing, demonstrating two services from one Docker image.
Overview¶
| Tech Stack | Ruby 3.3 / Sinatra + Sidekiq |
| Services | 2 (api + worker) |
| Database | PostgreSQL |
| Cache | The managed Redis cache |
| Pattern | Background workers |
The appmecca.yaml¶
containers:
- name: app
dockerfile: Dockerfile
context: .
deploy:
- name: api
container: app
port: 4567
health_check:
path: /health
- name: worker
container: app
command: "bundle exec sidekiq -r ./worker.rb"
database:
enabled: true
redis:
enabled: true
Key Concepts¶
Sidekiq Workers¶
Sidekiq is Ruby's most popular background job processor. It uses Redis as a message broker and processes jobs concurrently using threads. The worker service runs sidekiq -r ./worker.rb to load and execute worker classes.
Portless Worker Service¶
The worker has no port field, making it a portless service. AppMecca gives it no public hostname and no routing rule — nothing outside the platform can reach it. The worker only talks to PostgreSQL and Redis.
A portless service also needs no health_check block: omit it and AppMecca skips health checking for that service entirely.
Step-by-Step Deployment¶
1. Register the app¶
2. Build¶
3. Deploy¶
4. Verify¶
The worker has no URL — check it is alive with its logs instead:
What's Next¶
- Express + BullMQ Workers -- Node.js version with 3 services
- Django + Celery Tasks -- Python version with Celery