0x111 / telegram-rss-bot

RSS bot for telegram written in Go
MIT License
41 stars 21 forks source link

Dockerfile data? #11

Open jtagcat opened 3 years ago

jtagcat commented 3 years ago

Where is the data stored? Also document in readme.

/code/bot.db + config from ENV?

0x111 commented 3 years ago

The DB_PATH env variable controls where the database file is stored (for docker). Default being "./bot.db" e.g. current directory from where the binary runs.

Other than that, you can set the environment variables when running docker container with, in this case the DB_PATH, so your command could look like this:

docker pull ruthless/telegram-rss-bot
docker run -e TELEGRAM_AUTH_KEY="MY-TOKEN" -e DB_PATH="./path/to/my/database.db" ruthless/telegram-rss-bot

Then of course you can use volume mounts to make this storage persistent.

Without a docker, you can easily set this path in the config file for the bot.

I agree, the docs could be clearer on this, since right now, except the template file, there is no docs on this.