Skip to content

Commit

Permalink
feat: setup Docker file for bot
Browse files Browse the repository at this point in the history
  • Loading branch information
kkkiikkk committed Sep 15, 2024
1 parent 86f83b6 commit 62903c1
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 3 deletions.
16 changes: 16 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
FROM ruby:3.3.4

WORKDIR /app

RUN apt-get update && apt-get install -y tzdata
ENV TZ=Europe/Kyiv

COPY Gemfile Gemfile.lock ./

RUN bundle install

COPY . .

RUN chmod +x /app/bin/reminder

CMD ["ruby", "/app/bin/reminder"]
11 changes: 11 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
services:
reminder:
build: .
container_name: reminder_service
volumes:
- .:/app
environment:
- GROUP_ID=${GROUP_ID}
- CHAT_ID=${CHAT_ID}
- BOT_TOKEN=${BOT_TOKEN}
command: ruby /app/bin/reminder
1 change: 0 additions & 1 deletion lib/reminder/commands/start_command.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ def initialize(msg)
end

def execute
puts @msg.chat.id
Reminder::Config.bot.api.send_message(chat_id: @msg.chat.id, text: "INIT")
end
end
Expand Down
4 changes: 2 additions & 2 deletions lib/reminder/jobs.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ def initialize

@schedule = [
{
time: '22:40',
time: '7:40',
title: "Комп'ютерна логіка",
link: 'https://meet.google.com/ecq-furq-hbq'
},
Expand All @@ -33,7 +33,7 @@ def perform

def send_reminder(title, link)
message = "#{title} \n#{link}"

Reminder::Config.bot.api.send_message(chat_id: Reminder::Config::CHAT_ID, text: message)
end
end
Expand Down

0 comments on commit 62903c1

Please sign in to comment.