xmr-node-proxy
xmr-node-proxy copied to clipboard
Docker
This adds a simple dockerfile based on the install.sh.
I have pushed the image to docker hub for testing purposes, you can find it here: https://hub.docker.com/r/nikolashermann/xmr-node-proxy/
If memory serves right, the ubuntu:16.04 image loads everything as root. The proxy certainly doesn't need root access to run, can you add a USER parameter to this to lock out the proxy to run as a non-root user, or confirm this doesn't, and I'll pull it in.
Yes, that's right @Snipa22 and @nikolashermann, no need to run this as root. If it helps, you can have a look at my Dockerfile here (still a little messy, I'll clean up and add a new commit soon).
A few more pointers worth noting:
- Keep the image as small as possible by adding fewer layers. Grouping
RUNcommands together will help and a little apt-get house keeping too; - No need to expose those ports. If the user changes the config and uses other ports then those are exposed needlessly;
- Don't copy
config-example.jsontoconfig.json. Let the user provide their own. Example usage
With regard to the documentation, I'd advise you update to the new syntax. Although that remains backward compatible, I imagine it's just a matter of time before that syntax stops working. So, your instructions should therefore read:
docker image build --force-rm -t xmr-node-proxy . and docker container run -d -v $(pwd)/config.json:/app/config.json -p PORT:PORT xmr-node-proxy.
Alternatively, users can also pull the image from Docker without needing to build it. Personally, I'll be using mine for my proxies and I'll do my best to maintain it as new versions of the proxy are released, but I also agree that users could benefit from this Dockerfile and instructions on how to build their own if they are so inclined.