Elixir Deploy
DevOps & Securityelixir-deployElixir Deploy is an Agent Skill for devops & security published in the nixopus/nixopus repository on GitHub: a SKILL.md instruction file an AI agent can load to do this task.
Build and deploy Elixir and Phoenix applications — version detection, mix releases, and Dockerfile patterns. Use when deploying an Elixir or Phoenix project, or when mix.exs is detected.
QUICK START
How to use this skill
Bring this guide into your coding agent with a prompt tailored to the tool you use.
- Open your project in Codex.
- Copy and paste the prompt below.
- Review files and risks before approving any action.
Prompt to paste
Inspect the Agent Skill at https://github.com/nixopus/nixopus/blob/HEAD/api/skills/elixir-deploy/SKILL.md and all supporting files. Report provenance, permissions, scripts, dependencies, and security risks. Propose an exact installation into .agents/skills/elixir-deploy, but wait for my approval before writing files or running scripts.
Copying this prompt does not install or run the skill. Review third-party files before use.
Elixir Deployment
Detection
Project is Elixir if mix.exs exists in the root.
Versions
Elixir
.elixir-versionfilemix.exs→ detected from projectmise.tomlor.tool-versions- Defaults to 1.18
Erlang (OTP)
.erlang-versionfile- Resolved automatically from Elixir version
mise.tomlor.tool-versions- Defaults to 27.3
Build
Build Process
- Install Elixir and Erlang
- Get and compile deps:
mix deps.get --only prodandmix deps.compile - If defined:
mix assets.setup - If defined:
mix assets.deployandmix ecto.deploy - Compile and release:
mix compileandmix release
Start Command
/app/_build/prod/rel/<app_name>/bin/<app_name> start
Framework Detection
| Signal | Framework |
|---|---|
mix.exs + phoenix dep | Phoenix |
config/config.exs | Standard Elixir app |
config/runtime.exs | Runtime config (prod) |
Phoenix-Specific
- Asset pipeline: Node.js or esbuild; run
mix assets.setupandmix assets.deploy - Ecto:
mix ecto.setup(dev) /mix ecto.deploy(prod) - Release:
mix releaseproduces standalone tarball/binary
Install Stage Optimization
Copy in order:
mix.exs,mix.lockconfig/(full config directory)lib/,test/,assets/(Phoenix)
Base Images
| Stage | Image |
|---|---|
| Build | hexpm/elixir:1.18-erlang-27.3 or elixir:1.18 |
| Runtime | debian:bookworm-slim + extracted release, or elixir:1.18-slim |
Dockerfile Patterns
Phoenix Release
FROM hexpm/elixir:1.18-erlang-27.3 AS build
WORKDIR /app
RUN mix local.hex --force && mix local.rebar --force
COPY mix.exs mix.lock ./
RUN mix deps.get --only prod && mix deps.compile
COPY config config
COPY lib lib
COPY priv priv
COPY assets assets
RUN mix assets.deploy
RUN mix compile
RUN mix release
FROM debian:bookworm-slim
RUN apt-get update && apt-get install -y libssl3 ca-certificates && rm -rf /var/lib/apt/lists/*
WORKDIR /app
COPY --from=build /app/_build/prod/rel/my_app ./
EXPOSE 4000
CMD ["./bin/my_app", "start"]
Plain Elixir (no Phoenix)
FROM hexpm/elixir:1.18-erlang-27.3 AS build
WORKDIR /app
COPY mix.exs mix.lock ./
RUN mix deps.get --only prod && mix deps.compile
COPY config config
COPY lib lib
RUN mix compile && mix release
FROM debian:bookworm-slim
RUN apt-get update && apt-get install -y libssl3 ca-certificates && rm -rf /var/lib/apt/lists/*
WORKDIR /app
COPY --from=build /app/_build/prod/rel/my_app ./
CMD ["./bin/my_app", "start"]