This repository has been archived by the owner on Jul 24, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 57
/
Dockerfile.cron
48 lines (41 loc) · 1.67 KB
/
Dockerfile.cron
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
FROM ruby:2.6.5
# Add NodeJS repo
RUN curl -sL https://deb.nodesource.com/setup_12.x | bash -
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
RUN echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list
# Install dependencies and remove unneeded packages/files
RUN apt-get update -qq
RUN apt-get install -y --no-install-recommends cron \
nodejs \
git \
unzip \
xvfb \
libxi6 \
libgconf-2-4 \
apt-transport-https \
yarn
# Install packages
WORKDIR /usr/src/app
COPY Gemfile* /usr/src/app/
COPY Gemfile.lock* /usr/src/app/
RUN gem install bundler --no-document
RUN bundle install --without development test
# Setup app files
COPY . /usr/src/app/
WORKDIR /usr/src/app
COPY config/database.yml.example.production config/database.yml
# Create log file and link to stdout
RUN touch /var/log/cron.log
# Add entrypoint
COPY entrypoint-cron.sh /usr/bin/
RUN chmod +x /usr/bin/entrypoint-cron.sh
ENTRYPOINT ["entrypoint-cron.sh"]
# Update and cleanup container
RUN apt-get upgrade -y && apt-get autoclean \
&& apt-get autoremove -y \
&& rm -rf /var/lib/apt \
/var/lib/dpkg \
/var/lib/cache \
/var/lib/log
# App startup
CMD ["cron", "-f"]