Hello Elixir¶
A minimal Plug/Bandit application in Elixir. Multi-stage Docker build with OTP release. One container, one service, no database, no cache.
Overview¶
| Repository | git@gitlab.com:appmecca-sample-apps/hello-elixir.git |
| Tech Stack | Elixir 1.16 / Plug / Bandit |
| Services | web (port 4000) |
| Database | None |
| Cache | None |
| URL Pattern | https://hello-elixir-web.{env}.appmecca.net |
What This App Demonstrates¶
- Deploying an Elixir application on AppMecca
- Multi-stage Docker build (Elixir compiler + Debian runtime)
- OTP release for production deployment
- Health check endpoint pattern
appmecca.yaml¶
containers:
- name: hello-elixir
dockerfile: Dockerfile
context: .
deploy:
- name: web
container: hello-elixir
port: 4000
health_check:
path: /health
The configuration is identical in structure to any other single-container app. The Elixir app listens on port 4000.
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¶
OTP releases¶
Elixir applications are packaged as OTP releases -- self-contained bundles that include the BEAM virtual machine, all compiled modules, and the application's dependency tree. This means the runtime image does not need Elixir or Erlang installed, just the BEAM's minimal system dependencies.
Plug and Bandit¶
Plug is Elixir's HTTP middleware specification (similar to Rack in Ruby or WSGI in Python). Bandit is a modern HTTP server for Plug that runs on the BEAM. Together they provide a lightweight, concurrent web server with Elixir's trademark fault tolerance.
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
- Hello Ruby -- see the same pattern in Ruby
- Hello Bun -- see the same pattern with Bun/TypeScript
- App with Database -- add PostgreSQL to your application