Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Docker #8

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*.log
.ruby-verion
20 changes: 20 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
FROM ruby:2.5-alpine

RUN apk add --no-cache \
bash \
build-base

RUN mkdir /app
WORKDIR /app

COPY Gemfile .
COPY Gemfile.lock .

RUN bundle install

COPY . .

ENV NO_RBENV=1
RUN whenever --update-crontab

CMD crond -l 2 -f
8 changes: 7 additions & 1 deletion config/schedule.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,11 @@
set :frequency, ENV['FREQUENCY'].to_i

every frequency.hours do
script 'rbenv exec bundle exec ./bin/script'
script_cmd =
if ENV['NO_RBENV']
'bundle exec ./bin/script'
else
'rbenv exec bundle exec ./bin/script'
end
script script_cmd
end