rusty-kaspa
rusty-kaspa copied to clipboard
Add Dockerfile
README.md: I think rusty-kaspa is a better tag
A few suggestions on changes to the Dockerfile based on Docker best practices:
- A VOLUME should be declared for the data folder (~/.rust-kaspa)
- EXPOSE could be used to declare the exposed ports (e.g. 16111, 16110, 17110, 18110 for mainnet)
- ENTRYPOINT could be kaspad. Since you bundle two executables, you might opt to leave ENTRYPOINT empty and specify the executable in CMD instead.
- CMD should be common sense default arguments to kaspad in array format (e.g. ["--yes", "--nologfiles", "--disable-upnp", "--utxoindex", "--rpclisten=0.0.0.0:16110", "--rpclisten-borsh=0.0.0.0:17110", "--rpclisten-json=0.0.0.0:18110"]) Docker containers runs on an internal network by default, upnp is not relevant and rpc ports must be exposed to all interfaces for it to be reachable using Docker port forwarding. The listen port (16111) is already public by default.
- A USER could ideally be declared to run with non-root permissions. It will complicate things a bit though as the user must be created beforehand. If a custom host folder is to be mounted in as the datafolder the folder must also be chowned to 16111 on the host. In case this is added, info on how to handle host mounts must be added to the README.md
EDIT: Revised the comment about ENTRYPOINT