oliver-kriska/claude-elixir-phoenix / targets/amp/skills/deploy
deploy
VerifiedElixir/Phoenix deployment patterns — Dockerfile, fly.toml, runtime.exs, mix release, rel/ overlays. Use when configuring Fly.io, Docker, CI/CD, health checks, or production migrations.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 4.5 KB |
| references/docker-config.md | markdown | 2.9 KB |
| references/flyio-config.md | markdown | 1.6 KB |
references/docker-config.md
View on GitHub# Docker Configuration Reference
## Multi-Stage Build
```dockerfile
# Dockerfile
ARG ELIXIR_VERSION=1.18.0
ARG OTP_VERSION=27.0
ARG DEBIAN_VERSION=bookworm-20240130-slim
ARG BUILDER_IMAGE="hexpm/elixir:${ELIXIR_VERSION}-erlang-${OTP_VERSION}-debian-${DEBIAN_VERSION}"
ARG RUNNER_IMAGE="debian:${DEBIAN_VERSION}"
# Build stage
FROM ${BUILDER_IMAGE} as builder
RUN apt-get update -y && apt-get install -y build-essential git \
&& apt-get clean && rm -f /var/lib/apt/lists/*_*
WORKDIR /app
RUN mix local.hex --force && \
mix local.rebar --force
ENV MIX_ENV=prod
# Dependencies
COPY mix.exs mix.lock ./
RUN mix deps.get --only $MIX_ENV
RUN mkdir config
# Config
COPY config/config.exs config/${MIX_ENV}.exs config/
RUN mix deps.compile
# Assets (esbuild + tailwind, configured in config/config.exs)
COPY priv priv
COPY assets assets
RUN mix assets.deploy
# Application
COPY lib lib
RUN mix compile
# Release
COPY config/runtime.exs config/
COPY rel rel
RUN mix release
# Runner stage
FROM ${RUNNER_IMAGE}
RUN apt-get update -y && \
apt-get install -y libstdc++6 openssl libncurses6 locales ca-certificates \
&& apt-get clean && rm -f /var/lib/apt/lists/*_*
RUN sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen && locale-gen
ENV LANG=en_US.UTF-8
ENV LANGUAGE=en_US:en
ENV LC_ALL=en_US.UTF-8
WORKDIR /app
RUN chown nobody:nogroup /app
USER nobody:nogroup
COPY --from=builder --chown=nobody:nogroup /app/_build/prod/rel/my_app ./
ENV HOME=/app
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \
CMD curl -f http://localhost:4000/health/liveness || exit 1
CMD ["bin/my_app", "start"]
```
## Release Configuration
### mix.exs
```elixir
def project do
[
releases: [
my_app: [
strip_beams: [keep: ["Docs"]],
include_erts: true,
config_providers: [],
steps: [:assemble, :tar]
]
]
]
end
```
### rel/env.sh.eex
```bash
#!/bin/sh
# Clustering setup
export RELEASE_DISTRIBUTION=name
export RELEASE_NODE="${FLY_APP_NAME}@${FLY_PRIVATE_IP:-127.0.0.1}"
# For Fly.io IPv6
export ERL_AFLAGS="-proto_dist inet6_tcp"
```
### rel/vm.args.eex
```
## Performance tuning
+sbwt very_short
+swt very_low
## Increase process limit
+P 1000000
## Enable dirty schedulers
+SDio 16
## Disable kernel poll on containers (can cause issues)
# +K true
```
## Migration in Production
```elixir
# rel/overlays/bin/migrate
#!/bin/sh
cd -P -- "$(dirname -- "$0")"
exec ./my_app eval MyApp.Release.migrate
# lib/my_app/release.ex
defmodule MyApp.Release do
@app :my_app
def migrate do
load_app()
for repo <- repos() do
{:ok, _, _} = Ecto.Migrator.with_repo(repo, &Ecto.Migrator.run(&1, :up, all: true))
end
end
def rollback(repo, version) do
load_app()
{:ok, _, _} = Ecto.Migrator.with_repo(repo, &Ecto.Migrator.run(&1, :down, to: version))
end
defp repos, do: Application.fetch_env!(@app, :ecto_repos)
defp load_app, do: Application.load(@app)
end
```
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| writing-skillsobra/superpowersUse when creating new skills, editing existing skills, or verifying skills work before deployment | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| xlsxanthropics/skillsUse this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing .xlsx, .xlsm, .xltx, .csv, or .tsv file (e.g., adding columns, computing formulas, formatting, charting, cleaning messy data); create a new spreadsheet from scratch or from other data sources; or convert between tabular file formats. Trigger especially when the user references a spreadsheet file by name or path — even casually (like "the xlsx in my downloads") — and wants something done to it or produced from it. Also trigger for cleaning or restructuring messy tabular data files (malformed rows, misplaced headers, junk data) into proper spreadsheets. The deliverable must be a spreadsheet file. Do NOT trigger when the primary deliverable is a Word document, HTML report, standalone Python script, database pipeline, or Google Sheets API integration, even if tabular data is involved. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| shipping-and-launchaddyosmani/agent-skillsPrepares production launches. Use when preparing to deploy to production, or when asking what needs to be in place before shipping. Use when you need a pre-launch checklist, when setting up monitoring, when planning a staged rollout, or when you need a rollback strategy. | Stars: 119k | Updated | Claude CodeCodex | Verified | Install |
| childhoodthedotmack/claude-memBabysit a shipped release after merge, publication, or deployment. Verify published packages, production behavior, installed plugins, and late CI or user reports until the observation window is clean; use babysit for PR readiness before release. | Stars: 118k | Updated | Claude CodeCodex | Verified | Install |