No Description

Adphi 640027ffef Fix README.md 1 year ago
.idea f6ced5456e Init 1 year ago
app f6ced5456e Init 1 year ago
bin f6ced5456e Init 1 year ago
config f6ced5456e Init 1 year ago
db f6ced5456e Init 1 year ago
images f6ced5456e Init 1 year ago
lib f6ced5456e Init 1 year ago
log f6ced5456e Init 1 year ago
public f6ced5456e Init 1 year ago
tmp f6ced5456e Init 1 year ago
vendor f6ced5456e Init 1 year ago
.gitignore f6ced5456e Init 1 year ago
.ruby-version f6ced5456e Init 1 year ago
Dockerfile. f6ced5456e Init 1 year ago
Gemfile f6ced5456e Init 1 year ago
Gemfile.lock f6ced5456e Init 1 year ago
README.md 640027ffef Fix README.md 1 year ago
RailsTest.iml f6ced5456e Init 1 year ago
Rakefile f6ced5456e Init 1 year ago
config.ru f6ced5456e Init 1 year ago

README.md

Rails Whenever Dockerfile Demo

every 1.minute do
  command "echo Hello >> /app/log/cron.log"
end
FROM ruby:2.5

RUN apt-get update && \
    apt-get install -y cron && \
    rm -rf /var/lib/apt/lists/*

ENV LANG C.UTF-8
ENV RAILS_ENV production
ENV INSTALL_PATH /app

RUN mkdir $INSTALL_PATH && \
    mkdir log && touch /log/cron.log

ADD Gemfile Gemfile.lock ./

WORKDIR $INSTALL_PATH

RUN bundle install
COPY . .
RUN bundle exec whenever --update-crontab
CMD cron && rails server -e $stdout.sync=true

Container's Bash Result :

Container's terminal