Failed to bind properties under 'server.port' to java.lang.Integer

Viewed 5559

Some time ago I faced with such issue:

Failed to bind properties under 'server.port' to java.lang.Integer:

    Property: server.port
    Value: $PORT
    Origin: "server.port" from property source "systemProperties"
    Reason: failed to convert java.lang.String to java.lang.Integer

Action:

Update your application's configuration

I tried to run my docker container in DigitalOcean. I observed some similar topics here and I tried to apply advices. For instance I added server.port=${PORT:8080} to my application.properties but it didn't work for me.

Here's my docker run command:

docker run -p 8080:8080 --name nostalgia --env-file vars.txt --rm -it registry.digitalocean.com/alex-registry/nostalgia

And this is my vars.txt (only one variable at the moment):

PORT=8080

Also I should say that I tried another form of command:

docker run -p 8080:8080 --name nostalgia -e PORT=8080 --rm -it registry.digitalocean.com/alex-registry/nostalgia

But result is the same. What should I do next to overcome this issue and successfully launch the container? Thanks for your answers!!!

0 Answers
Related