microblink / docker

Microblink's Docker Images implementations, available at https://hub.docker.com/u/microblink
7 stars 5 forks source link

Running on Heroku #2

Open jamesmfriedman opened 5 years ago

jamesmfriedman commented 5 years ago

Heroku automatically exposes the containers internal port as $PORT. Looking a bit into the issue, it seems like SpringBoot and Heroku can be made to work together with the following command?

-Dspring.server.port=$PORT

I'm a bit new to Docker and have never touched Java. Would this go into the cmd part of the dockerfile?

I know I can't build a Docker image myself. I'd really prefer to be able to deploy on Heroku since thats where the rest of our tech stack currently is. I have a demo license that expires in 16 days so I'd love to see if there is a simple fix to this.

ncc0706 commented 4 years ago

try this

CMD [ "sh", "-c", "java -Dserver.port=$PORT -Xmx300m -Xss512k -Dfile.encoding=UTF-8 -Dspring.profiles.active=prod -Djava.security.egd=file:/dev/./urandom -jar /opt/application.jar" ]
jamesmfriedman commented 4 years ago

@ncc0706 They fixed this a while back, you can just use the PORT env variable now.