You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
Adphi 640027ffef Fix README.md 5 years ago
.idea Init 5 years ago
app Init 5 years ago
bin Init 5 years ago
config Init 5 years ago
db Init 5 years ago
images Init 5 years ago
lib/tasks Init 5 years ago
log Init 5 years ago
public Init 5 years ago
tmp Init 5 years ago
vendor Init 5 years ago
.gitignore Init 5 years ago
.ruby-version Init 5 years ago
Dockerfile. Init 5 years ago
Gemfile Init 5 years ago
Gemfile.lock Init 5 years ago
README.md Fix README.md 5 years ago
RailsTest.iml Init 5 years ago
Rakefile Init 5 years ago
config.ru Init 5 years 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