From gleam
Guides Claude through deploying Gleam applications to production on Fly.io, Docker, or other platforms. Use when setting up deployment pipelines, configuring environments, or troubleshooting production issues.
How this skill is triggered — by the user, by Claude, or both
Slash command
/gleam:gleam-deploymentThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
This skill guides Claude Code through deploying Gleam applications to production.
This skill guides Claude Code through deploying Gleam applications to production.
Complete step-by-step guide: Gleam on Fly.io
Key points:
0.0.0.0 (use mist.bind("0.0.0.0"))flyctl deployGleam apps can deploy to any platform supporting:
Build optimized Erlang release:
gleam export erlang-shipment
This creates a standalone release in build/erlang-shipment/.
Build JavaScript bundle:
gleam build --target javascript
Output in build/dev/javascript/.
Example from Fly.io guide:
# Stage 1: Build
FROM ghcr.io/gleam-lang/gleam:v1.10.0-erlang-alpine AS builder
WORKDIR /app
COPY . .
RUN gleam export erlang-shipment
# Stage 2: Runtime
FROM erlang:27.1.1.0-alpine
WORKDIR /app
COPY --from=builder /app/build/erlang-shipment /app
RUN adduser -D webapp
USER webapp
ENTRYPOINT ["/app/entrypoint.sh"]
CMD ["run"]
See complete example: Fly.io Deployment Guide
Best practices:
Use Envoy for environment configuration:
import envoy
pub fn main() {
let assert Ok(port) = envoy.get("PORT")
|> result.then(int.parse)
let assert Ok(db_url) = envoy.get("DATABASE_URL")
start_server(port, db_url)
}
See: Envoy Documentation
For complex configuration, consider:
See: Wisp Security
Use connection pools for databases:
Patterns for database migrations:
See: Cigogne - Postgres migrations in Gleam
Production logging strategies:
BEAM/OTP monitoring:
:observer, :recon)Implement health check endpoints:
fn handle_request(req: Request) -> Response {
case wisp.path_segments(req) {
["health"] -> wisp.response(200)
|> wisp.set_body(wisp.Text("OK"))
// other routes...
}
}
gleam export erlang-shipment for optimized buildsname: Deploy
on:
push:
branches: [main]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install Gleam
uses: erlef/setup-beam@v1
with:
gleam-version: "1.10.0"
- name: Run tests
run: gleam test
- name: Deploy to Fly.io
uses: superfly/flyctl-actions@master
with:
args: "deploy"
env:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
Port binding: Ensure listening on 0.0.0.0, not localhost
Environment variables: Verify all required vars are set in platform
File permissions: Run as non-root user, check file ownership
Build failures: Check Dockerfile layer caching, dependencies
Strategies:
Remember: Gleam compiles to mature, battle-tested runtimes (BEAM, JavaScript). Focus on platform-specific deployment concerns.
npx claudepluginhub renatillas/gleam --plugin gleamGuides completion of development work by verifying tests, detecting environment, and presenting structured options for merge, PR, or cleanup.
Enforces test-driven development: write failing test first, then minimal code to pass. Use when implementing features or bugfixes.
Guides creation and editing of skills using test-driven development with pressure scenarios and subagents to verify agent compliance.