Server_url env variable for docker

Hello,
We are using the docker linux container and runningit on kubernetes. Is there an environemnt variable we can use to set the server url or another way of doing it without setting it in the GUI?
Thanks for the help.
Cheers,
Ian

Or is this a case of having to do it manually and then it is saved in the database and it never has to be done again when pods are restarted?

Hey @ianburrows.sa,

Thanks for reaching out.

Unfortunately, it looks like there is no variable or parameter you can set in either the docker env or in Octopus.Server.exe.

If you’d like to potentially get this added to a future version of Octopus or our container, you can suggest it at our UserVoice here: https://octopusdeploy.uservoice.com/

In the meantime, what you could do as part of your process of spinning up your docker container is you could run a PUT API call on the server to the serverurl/api/serverconfiguration endpoint with the JSON body of:

{
   "Id":"serverconfig",
   "ServerUri":"URL_YOU_WANT_HERE",
   "Links":{
      "Self":"/api/serverconfiguration"
   }
}

It does get set in the database when you do this, so you should only need to run it the first time you set up the Octopus instance.

Please let me know if you think that will fit your use case.

Best,
Jeremy

Thanks Jeremy. I will suggest a change at uservoice as I think this would be useful especially when migrating an octopus server.
Thank you for the assistance.
Best,
Ian

Hi Ian,

You’re very welcome. I did also pass it along to our developers but it’s also best to get it logged in UserVoice so thank you for doing that.

Please let me know if you have any other questions regarding it, but if we don’t speak soon, I hope you have a great rest of your week.

Best,
Jeremy