ASH setup - docker container with same server

I am trying to setup ASH using the same docker-compose.yml as the main server

I am reading this, seems like a catch 22, it expects the URL and KEY but that server is in the same compose file and hence is in the process of being setup so I can’t actually get the URL and create an API key in time for the work to be created.

Am I missing something here?

That’s a good one. Thank for your feedback about the docs.

Usually, you’d need to create the API key before modifying your compose file.

One way to do it, is using the provisioning file and setup command as explained here.

I gave it a quick update. The code snippet to use in the same docker stack only requires updating the api key to match yours. find it here.

Hey!!!

With ASH in docker-compose, you’re running into the classic chicken-and-egg problem.

The trick is that you can’t count on the container being fully up to make its own API key when it starts up.

Most of the time, people either create the API key ahead of time and inject it through environment variables, or they spin up a temporary instance to make the key and then use it in the main compose.

There is no magic that lets the container start up the key on its own while it is still setting up.

That’s true.

Personally, on my side, I firstly ran the docker setup without the ASH part. once it’s working, I then modified the docker setup and added the ASH part.