-
-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Docker support #2
Comments
Definitely something I wanted to pursue with this bot! Adding it to my to-do. :) |
I published a Dockerfile in the docker-test branch and put it on Docker Hub. To run it first create a volume:
Then set up the docker container which will also lead you through the configuration wizard:
Now the bot can be stopped by pressing Ctrl+C and then started in the background with the following command:
If you (@ShaddyDC) or someone else knows more about Docker and can help me, as I've only just learned about it during the last two days, please comment on issues before I'll merge this. Thank you! |
So, I haven't got around to playing around with it, so I don't know which parts are exactly needed where, and what I'm saying is only what I got from looking it over without any actual testing or investigating. I also have to say that while I've worked with docker some, I'm probably not aware of a bunch of best practices. I'm not sure if .net is required for actually running it or only for building. In the latter case I would suggest using a multi-stage build with the corresponding image. In that case you also wouldn't need the ENV variables anymore. I think I've read somewhere about clearing the apt cache after doing your installations or removing the tools after they're not needed anymore to keep the image slim, but it isn't hugely important, at least to me. However, if it works, you could try using the You can save the Similarly, is there a specific reason you're using COPY twice? The second call would include all the files of the first one, so I'm not sure it's necessary. I don't know if it makes a difference in caching though. You can also reorder some stuff for better caching of build stages, but I don't know which of those commands can be cached or any details from the top of my head, so I won't comment until I've played with it around some. I can properly look into it later this weekend or early next week. |
Alright, thanks for the insight. I'll play around with the Alpine image. The .NET Core SDK could indeed be removed and replaced by the runtime after building osu-tools, this would make multi-stage builds even more complicated though so I'd rather keep it the current way even though it's a little messy. The reason I run COPY twice like that is simply because I've seen it written that way in every Docker for Node.js example. 🤷 |
Some small things. I've never worked with node.js, so I haven't really dug deep into it and can only give some superficial feedback. Firstly it would be nice if the config file was detached form the bot folder. Then you could just take an empty local directory and use that as the volume, One more thing which is mostly for convenience, just throw the bot into Some minor things: Maybe run Edit: I just remembered, you could use oppai-ng instead of the osu tools to avoid the need for .net. I don't know how accurate it actually is, but it probably is accurate enough. It looks like it also supports star difficulty calculation. Though you've commented on an issue there, so you've probably got a reason for not using it. |
add osu api v2 stuff to config wizard
The bot looked kind of nice, but I'm a lazy bum who hates installation steps and a sucker for docker.
Therefore adding support for Docker by providing a Dockerfile would be nice since you could then easily spin up an instance wherever docker is installed. Maybe even throw it on dockerhub so you could pull and run it with one command.
I don't have access to my computer currently, but I can probably write one in a week or so if that's something you could see adding.
The text was updated successfully, but these errors were encountered: