qaul.net icon indicating copy to clipboard operation
qaul.net copied to clipboard

Dockerizing qauld to enable self-hosting

Open brenodt opened this issue 2 years ago • 4 comments

Opening an issue so it's easier to track the status of this feature.

Discussed in https://github.com/qaul/qaul.net/discussions/518

Originally posted by huang12zheng January 24, 2023 I found that without documentation and best practices for relay nodes, Maybe we could add it somewhere?

This is an example that I wrote https://github.com/huang12zheng/qaul.net/tree/dockerfile

brenodt avatar Jan 24 '23 17:01 brenodt

The feature has been documented here: https://qaul.github.io/qaul.net/#/qaul/infra/self-hosting-qauld

And committed via this pull request: #526

Thanks @brenodt for doing so

MathJud avatar Feb 05 '23 13:02 MathJud

A nice thing to have for the future, could be the possibility to define the "Port" and the node "Name" in a docker-compose.env file and make it accessible to the docker container via the environment settings in dock-compose.yml.

Just in case, that it would be preferable to overwrite the startup command in the dockerfile itself we could do so in the docker-compose.yml command section. IMHO the environment option gives us most probably enough flexibility.

MathJud avatar Feb 05 '23 13:02 MathJud

I do agree, this sounds reasonable. One issue could be the fact that the name and port flags only take effect the first time the image is spinned-up - subsequent ones take the config.yaml file. The user can, of course, change it manually: we already describe in the docs how to map the configuration folder into the host. But this renders the environment variable only useful on the first execution of the container, I believe.

brenodt avatar Feb 06 '23 18:02 brenodt

One solution is for qauld to check for the presence of env variable and override the value from config.yaml if the variable is present. Maybe write something to the log like "env variable found, overriding config port value to wxyz". Could we request a feature like that? This is the best practice for containerized apps see https://medium.com/hackernoon/how-to-dockerize-any-application-b60ad00e76da (#7).

Or I could easily add an envsubst bit for the entry point, no app modification required in that case.

taro-ball avatar Dec 22 '23 23:12 taro-ball