Skip to content
This repository has been archived by the owner on Sep 28, 2021. It is now read-only.

Dockerize project #20

Closed
wants to merge 1 commit into from
Closed

Dockerize project #20

wants to merge 1 commit into from

Conversation

mralanlee
Copy link
Contributor

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

@illusi0nary
Copy link
Contributor

@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.
What do you think?

@mralanlee
Copy link
Contributor Author

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.

@LucasCtrl
Copy link
Member

I have never used a docker in the past. How does it work and what does it bring to the project?
I thought I read that the data in the container can be deleted if it crashes. There wouldn't be any problems with the project especially since the data is stored in the db/servers.json file?

@illusi0nary
Copy link
Contributor

@LucasCtrl the benefits of docker here would be that we can also deploy it easily to another server if your raspberry pi get overheated 👻
It also makes it easier to maintain for new contributors, because they do not need the prerequisite of npm beeing installed on their computer, they only need docker and in theory they could just use one command to start the bot.
We could also add some github actions based on that if its dockerized - to keep a little bit of standard up.

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.

@mralanlee
Copy link
Contributor Author

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.

@LucasCtrl
Copy link
Member

Ok thanks!
I know that @illusi0nary has started working on it and will explain me how it works in detail. Either he'll merge the PR because it's good or we'll do it later in the week 😉

@illusi0nary
Copy link
Contributor

@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 :-)

@ghost
Copy link

ghost commented Oct 4, 2020

What is Docker?

@illusi0nary
Copy link
Contributor

@dragonDScript maybe i should give an introduction like a little "Meetup" about docker and how it works?

@ghost
Copy link

ghost commented Oct 4, 2020

🐱‍👤 I'm a ninja cat. @illusi0nary

@mralanlee
Copy link
Contributor Author

What is Docker?

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.

@illusi0nary illusi0nary added enhancement New feature or request hacktoberfest Issue dedicated to the Hacktoberfest labels Oct 6, 2020
@illusi0nary
Copy link
Contributor

It is accepted, but will not be merged because it will come soon with a new update! :-)

@illusi0nary illusi0nary closed this Oct 6, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request hacktoberfest Issue dedicated to the Hacktoberfest
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Adding Docker to the project
3 participants