ConceptsEnvironment & env groups
The PORT variable
Ferry chooses the container port at each deploy and gives it to your app in PORT.
Ferry chooses the container port one time for each deploy.
1 / 4
This page is for the services that listen: web services, private services and static sites. An app that reads PORT works with no configuration.
How Ferry chooses the port
Ferry uses the first value that it finds:
- the port setting of the service (
--port,port:in a blueprint) - a
PORTvariable that you set - the hint of the build:
80for static sites that nginx serves - the port that the image
EXPOSEs, if it exposes exactly one - the server default,
--default-port(10000)
An app with a fixed port
If your app listens on a fixed port, set it with --port.
ferry update api --port 3000Do 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.