-
-
Notifications
You must be signed in to change notification settings - Fork 12
Conversation
@mralanlee wouldn't it be cool if we have a make file with the regarding commands? So we do not need to build the image manually Also it would be beneficial if we have a docker-compose file for it. |
A Makefile could make sense but I was thinking if you wanted to pipe this project into a CI and if you wanted to set a span of support on NodeJS versions (i.e. 8-12 for example), you can build multiple images and have it available or tested. Let me know your thoughts on that and I could create a makefile around those requirements. As for the docker-compose, I'm not sure you're using any other dependencies. I see that you have lowdb setup, which seems to use local volume storage as a database. I would think if you have any additional dependencies like redis, mysql, or etc, it would probably make the most sense to add a docker-compose requirement then. |
I have never used a docker in the past. How does it work and what does it bring to the project? |
@LucasCtrl the benefits of docker here would be that we can also deploy it easily to another server if your raspberry pi get overheated 👻 Docker in general is a seperated environment which is the same for everyone so we do not tackle the issue that node versions are not matching or new contributors complain about that it is not working for them. For the persistance we could use a mounted volume which is then not deleting stuff or just a simple docker volume which is a bit more temporary - but i would suggest going with a mounted volume. |
Pretty much with @illusi0nary has stated. It pretty much guarantees that if the docker image builds and runs on your computer (or a contributors setup) fine, it should work fine in a CI environment, others computers, or a server without any problem. |
Ok thanks! |
@LucasCtrl i will just do the server infrastructure and the github actions and we can possibly look forward to use this branch as a base for the dockerisation :-) |
What is Docker? |
@dragonDScript maybe i should give an introduction like a little "Meetup" about docker and how it works? |
🐱👤 I'm a ninja cat. @illusi0nary |
In short, Docker is containerization technology. It lets you isolate the dependencies and the application an image. It packs all the things you need to run this application and ensures that if someone else was to run it, it'd work exactly the same. For this specific case, it means that people with different versions of Node.js OR if they do not have Node.js installed, they can run this application on their computer without worrying about dependency issues (because its already baked into the application). Now, imagine you have to deploy this to a server or the cloud. You may do your dev work on MacOS or Windows, but say you'd want to deploy this to an Ubuntu server, where the requirements or specs of the server differs from your own environment. Before Docker, you'd have to make sure you provision your server with the right dependencies of Node.js or anything else that the host may require to run an application. Docker pretty much simplifies that. |
It is accepted, but will not be merged because it will come soon with a new update! :-) |
Closes #17
To build run:
docker build --build-arg NODE_VERSION=12.18.2 -t spookybot:latest .
Currently, blocked by #19, otherwise
docker run spookybot:latest
would work