Detection
migetpacks detects an Elixir application when either of the following files is present in the project root:mix.exsmix.lock
Version Detection
Elixir Version
Elixir version is resolved in the following priority order:Erlang/OTP Version
Erlang version is resolved from:If no Erlang version is specified, the Elixir Docker image’s bundled Erlang/OTP version is used, which is guaranteed to be compatible.
Build Process
migetpacks generates a multi-stage Dockerfile using official Elixir images:Phoenix Framework Detection
Ifmix.exs contains a :phoenix dependency, migetpacks automatically:
- Copies
config/early (needed for dependency compilation) - Compiles assets using
mix assets.deploy(or falls back to npm-based asset pipeline) - Runs
mix phx.digestfor static file fingerprinting
Umbrella Project Detection
If anapps/ directory exists, migetpacks detects an umbrella project and copies child mix.exs files for proper dependency resolution.
Mix Releases
migetpacks detects if the project uses Mix releases by checking forreleases: in mix.exs. When releases are used:
- The release binary is self-contained (no Hex/Mix needed at runtime)
- The runtime image is slimmer
- The run command uses the release binary
- Hex and Mix are copied to the runtime image
- Git is installed at runtime (needed for git dependency verification)
mix phx.serveris used as the run command
Run Command
The default run command depends on whether Mix releases are configured:
Override with
RUN_COMMAND or a Procfile:
Runtime Configuration
Caching
Layer Caching
Dependencies are cached by copyingmix.exs and mix.lock before the full source:
BUILD_CACHE_DIR
WhenBUILD_CACHE_DIR is set, Hex and Mix dependency caches persist at:
DHI Support
WhenUSE_DHI=true is set, migetpacks will display a warning and continue using the official Elixir images:
Example
Phoenix application
Running Phoenix
Phoenix requiresSECRET_KEY_BASE at runtime. Generate one with mix phx.gen.secret or openssl rand -hex 64: