-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Added docker support * Documenting docker usage * Add docker hub option to README Co-authored-by: Richard Szolár <r@richardszolar.me>
- Loading branch information
Showing
6 changed files
with
69 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
FROM golang:1.14-buster | ||
|
||
CMD /bin/init.sh /bin/rss-bot | ||
|
||
COPY . /code | ||
|
||
WORKDIR /code | ||
|
||
RUN go get ./... | ||
|
||
RUN make gh_linux_amd64 | ||
RUN chmod -R g+rwx /code && cp build/telegram-rss-bot-linux-amd64 /bin/rss-bot && cp init.sh /bin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"telegram_auth_key": "TELEGRAM_AUTH_KEY", | ||
"migrations": "MIGRATIONS", | ||
"telegram_api_debug": TELEGRAM_API_DEBUG, | ||
"db_path": "DB_PATH", | ||
"log_level": "LOG_LEVEL", | ||
"feed_parse_amount": FEED_PARSE_AMOUNT, | ||
"feed_post_amount": FEED_POST_AMOUNT, | ||
"feed_updates_interval": FEED_UPDATES_INTERVAL, | ||
"feed_posts_interval": FEED_POST_INTERVAL | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/bin/bash | ||
|
||
set -ue | ||
|
||
keys="TELEGRAM_AUTH_KEY MIGRATIONS TELEGRAM_API_DEBUG DB_PATH LOG_LEVEL FEED_PARSE_AMOUNT FEED_POST_AMOUNT FEED_UPDATES_INTERVAL FEED_POST_INTERVAL" | ||
|
||
TELEGRAM_AUTH_KEY=${TELEGRAM_AUTH_KEY:=token} | ||
MIGRATIONS=${MIGRATIONS:=v1} | ||
TELEGRAM_API_DEBUG=${TELEGRAM_API_DEBUG:=false} | ||
DB_PATH=${DB_PATH:=./bot.db} | ||
LOG_LEVEL=${LOG_LEVEL:=info} | ||
FEED_PARSE_AMOUNT=${FEED_PARSE_AMOUNT:=5} | ||
FEED_POST_AMOUNT=${FEED_POST_AMOUNT:=2} | ||
FEED_UPDATES_INTERVAL=${FEED_UPDATES_INTERVAL:=600} | ||
FEED_POST_INTERVAL=${FEED_POST_INTERVAL:=400} | ||
|
||
mkdir -p /code/.telegram-rss-bot | ||
cp ./bot-config.template.json /code/.telegram-rss-bot/bot-config.json | ||
|
||
for key in $keys; do | ||
sed -i "s|$key|$(eval echo "\$${key}")|g" /code/.telegram-rss-bot/bot-config.json | ||
done | ||
|
||
echo Executing $* | ||
$* |