I'm using Dokku (like Heroku) to deploy an ASP.NET 5 Docker image, but I'm having trouble getting it to map the port properly.
- Dokku configures Nginx for you
- Dokku assigns a randomized web port that the Docker container should speak to
- The port to use is environment variable PORT = [randomized]
You can't set it manually, so there's no way to lock it to port 5000 (the default).
I tried changing the ENTRYPOINT in the Dockerfile to use substitution, but the ENTRYPOINT is not configured at runtime, so that is not possible.
I tried making a startup script instead:
#/bin/bash
dnx -p project.json web --server.urls http://0.0.0.0:${PORT}
Then in Dockerfile....
ENTRYPOINT ["/bin/bash", "./launch"]
However the port is STILL coming through as 5000. I have no idea why. How can I work around this?
I'm using Dokku (like Heroku) to deploy an ASP.NET 5 Docker image, but I'm having trouble getting it to map the port properly.
You can't set it manually, so there's no way to lock it to port 5000 (the default).
I tried changing the
ENTRYPOINTin the Dockerfile to use substitution, but the ENTRYPOINT is not configured at runtime, so that is not possible.I tried making a startup script instead:
Then in Dockerfile....
However the port is STILL coming through as 5000. I have no idea why. How can I work around this?