Label Reference

LabelDescriptionDefault
roji.hostCustom hostname{service}.dev.localhost
roji.portTarget portFirst EXPOSE’d port
roji.pathPath prefixnone
roji.mock.{METHOD}.{PATH}Mock response bodynone
roji.mock.status.{METHOD}.{PATH}Mock response status code200
roji.auth.basic.userBasic auth usernamenone
roji.auth.basic.passBasic auth passwordnone
roji.auth.basic.realmBasic auth realmRestricted
roji.selfReserved: excludes container from routing (internal use)none

roji.host

Override the default hostname ({service}.dev.localhost):

labels:
  - "roji.host=myapp.dev.localhost"

You can use any hostname. If it doesn’t contain a dot, it’s expanded with the configured domain.

roji.port

Specify which port roji should proxy to when a container exposes multiple ports:

expose:
  - "3000"
  - "9229"   # debugger
labels:
  - "roji.port=3000"

If not set, roji uses the first exposed port.

roji.path

Route requests matching a path prefix to this service:

labels:
  - "roji.host=myapp.dev.localhost"
  - "roji.path=/api"

Requests to https://myapp.dev.localhost/api/* will be routed to this service.

roji.mock.*

Define mock responses without a real backend:

labels:
  - "roji.host=api.dev.localhost"
  - 'roji.mock.GET./api/users=[{"id":1,"name":"Alice"}]'
  - 'roji.mock.GET./api/health={"status":"ok"}'
  - "roji.mock.status.POST./api/users=201"

See the Mock Routes guide for details.

roji.auth.basic.*

Protect a route with HTTP Basic Authentication:

labels:
  - "roji.auth.basic.user=admin"
  - "roji.auth.basic.pass=secret"
  - "roji.auth.basic.realm=Admin Area"   # optional

See the Basic Authentication guide for details.

roji.self

Reserved internal label. Marks a container to be excluded from routing. Used by roji itself when running in Docker mode. Do not set this on your own containers.