qaul.net
qaul.net copied to clipboard
Dockerizing qauld to enable self-hosting
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
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
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
.
-
Docker-Compose
.env
-file documentation -
Docker-Compose
environment
option documentation -
An example of another docker-compose project using the
.env
-file and theenvironment
option
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.
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.
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.