How to get the Gitlab runner host, or change it?

Viewed 106

Normally when I run my application it runs at http://localhost:3001. When I run this same application in a Gitlab pipeline, it says:

Project is running at http://runner-87654321-project-1234567-concurrent-0:3001/

Naturally, I cannot access the application, so how do I either change this to run at localhost, or get the runner url at runtime?

1 Answers

Service aliases might be what you're looking for: https://docs.gitlab.com/ee/ci/services/. So you can provide an image of your app and then refer to it with an alias.

I think it's better to make the app listen on all network interfaces. For instance, in Spring framework it's enough to set server.address=0.0.0.0 in the application properties file.

Related