Overview

migetpacks supports Procfiles for defining process types in your application. A Procfile declares the commands used to run different process types (web server, background workers, scheduled tasks, etc.).

Procfile Format

A Procfile is a plain text file named Procfile (no extension) in the project root. Each line declares a process type:
<process_type>: <command>

Example Procfile

web: bundle exec puma -C config/puma.rb
worker: bundle exec sidekiq
release: bundle exec rails db:migrate
clock: bundle exec clockwork clock.rb

Process Priority

migetpacks determines the main process command using the following priority order:
1

RUN_COMMAND environment variable

If set, this always takes precedence over any Procfile entry.
-e RUN_COMMAND="node server.js"
2

web: from Procfile

The web process type is the standard entry point for HTTP-serving applications.
3

First process in Procfile

If no web: entry exists, the first process declared in the Procfile is used.
4

Language-specific default

If no Procfile exists and RUN_COMMAND is not set, a language-specific default is used (e.g., node server.js, python app.py).

Language Examples

web: bundle exec puma -C config/puma.rb
worker: bundle exec sidekiq
release: bundle exec rails db:migrate

Result JSON

Process information from the Procfile is recorded in the build result JSON (when RESULT_FILE is set):
{
  "status": "success",
  "processes": {
    "web": "bundle exec puma -C config/puma.rb",
    "release": "bundle exec rails db:migrate",
    "workers": [
      {"name": "sidekiq", "command": "bundle exec sidekiq"},
      {"name": "clock", "command": "bundle exec clockwork clock.rb"}
    ]
  }
}

Process Classification

Process TypeClassificationDescription
webMain processHTTP-serving entry point
releaseRelease scriptRun during deployment (e.g., migrations)
Any otherWorkerBackground processes

Overriding with RUN_COMMAND

You can override the Procfile’s web process without modifying the file:
docker run --rm \
  -v /path/to/app:/workspace/source:ro \
  -v /var/run/docker.sock:/var/run/docker.sock \
  -e OUTPUT_IMAGE=registry.io/my-app:latest \
  -e RUN_COMMAND="bundle exec puma -p 5000 -w 4" \
  miget/migetpacks:latest
RUN_COMMAND only overrides the main container command (equivalent to Docker CMD). Worker processes from the Procfile are still recorded in the result JSON for deployment systems that support multiple process types.

DHI Considerations

When building with USE_DHI=true, Procfile commands are adjusted for distroless containers:
  • Shell-style commands are converted to exec format
  • Ruby shebang scripts (e.g., ./bin/rails) are prefixed with ruby (e.g., ruby bin/rails)
  • Shell variable expansions like ${PORT:-5000} are pre-expanded to literal values

Port Configuration

The PORT environment variable (default: 5000) is exposed in the container. Your Procfile command should bind to this port:
web: bundle exec puma -p $PORT

app.json Integration

If your project includes an app.json file, process formation (replicas) can be configured alongside the Procfile:
{
  "formation": {
    "web": {"quantity": 2, "size": "standard-1x"},
    "worker": {"quantity": 1}
  }
}
This formation data is included in the result JSON for deployment systems:
{
  "formation": [
    {"name": "web", "quantity": 2, "size": "standard-1x"},
    {"name": "worker", "quantity": 1, "size": null}
  ]
}