Hambergo / 9kmmrbot

MIT License
104 stars 29 forks source link

Dockerize #12

Closed tverghis closed 5 years ago

tverghis commented 5 years ago

I figured that since I was setting up a test environment for myself, this would be a good time to Docker-ize the application. In the future, we should be able to spin up instances of the bot super quickly.

Docker will also automatically restart the app/MongoDB if they crash.

~The docker-compose.yml file will pass the necessary environment variables through to the app. If you find it more ergonomic, we can also choose to define the values in an .env file. That way if you need to restart the box running the app you don't need to re-set all the environment variables; they will be read directly from the file. The downside is that the secrets are now stored in a file somewhere (but not tracked via git). Let me know if you prefer the .env file method, I'll have to make some changes.~

The environment variables will be read in from a vars.env file (not checked into git). https://docs.docker.com/compose/environment-variables/#the-env_file-configuration-option