Skip to content

Runtime roles ​

APP_ROLE decides which runners a single binary starts. These are three modes of one program, not three separate executables.

Values ​

ValueHTTP / gRPCQueues and schedulersUse case
allStartedStartedLocal development, single host
webStartedNot startedAPI layer in split deployments
workerNot startedStartedTask layer in split deployments

The default is all. At runtime the disabled runner list closes the matching runners. For example, web disables goravel:queue, goravel:schedule and mail:queue.

Single host ​

Use the default all role. One process handles everything, suitable for small scale and moderate concurrency.

Split deployment ​

Start web and worker as separate processes or containers against the same database and Redis:

  • web handles requests and enqueuing only, and consumes no tasks
  • worker consumes both default and emails queues and runs scheduled jobs
  • worker can scale horizontally; scheduled jobs deduplicate via OnOneServer() and execution locks

WARNING

Mail delivery depends on worker. web only enqueues. If worker is not running, mail stays queued while the API still returns success. Keep worker running in split deployments.

systemd injection ​

Prefix the role with /usr/bin/env rather than using only Environment=:

ini
[Service]
EnvironmentFile=/etc/missmeow-admin/app.env
ExecStart=/usr/bin/env APP_ROLE=web /opt/missmeow-admin/backend/bin/app serve

EnvironmentFile overrides variables of the same name in Environment=. If .env keeps APP_ROLE=all, a plain Environment= entry is silently overridden.

Next steps ​