FerryDocs

The PORT variable

Ferry chooses the container port at each deploy and gives it to your app in PORT.

Edit on GitHub
PORTFerrychooses the portYour appPORT=10000Health checkProxy

Ferry chooses the container port one time for each deploy.

1 / 4

This page is for the services that listen: , and . An app that reads PORT works with no configuration.

How Ferry chooses the port

Ferry uses the first value that it finds:

  1. the port setting of the service (--port, port: in a )
  2. a PORT variable that you set
  3. the hint of the build: 80 for static sites that nginx serves
  4. the port that the EXPOSEs, if it exposes exactly one
  5. the server default, --default-port (10000)

An app with a fixed port

If your app listens on a fixed , set it with --port.

Terminal
ferry update api --port 3000

Do not set PORT to a different value

If you set PORT to a value different from the port setting, the deploy log gives a warning. The app then listens on the wrong port.

On this page