41 lines
1.7 KiB
Docker
41 lines
1.7 KiB
Docker
FROM redmine:5-bullseye
|
|
|
|
COPY plugins/ plugins/
|
|
COPY patches/project_identifier.patch ./
|
|
COPY pre-entrypoint.sh /
|
|
|
|
ENV REDMINE_SEND_REMINDERS_DAYS=0 \
|
|
REDMINE_SEND_REMINDERS_CRON_EXPR="0 7 * * 1-5"
|
|
|
|
RUN apt-get update \
|
|
&& apt-get install -y cron nodejs gcc make \
|
|
# Compile FFI module \
|
|
&& chmod 770 /usr/local/bundle/gems /usr/local/bundle/extensions/x86_64-linux /usr/local/bundle/extensions/x86_64-linux/3.1.0 \
|
|
&& bundle check || bundle install \
|
|
# Clean-up \
|
|
&& apt-get purge -y --auto-remove gcc make \
|
|
&& apt-get clean \
|
|
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* ~/.cache \
|
|
# Remove default cron mess \
|
|
&& rm -f /etc/cron.daily/* \
|
|
&& rm -f /etc/cron.d/* \
|
|
# Install plugin dependencies \
|
|
&& bundle check || bundle install \
|
|
# For hourglass plugin \
|
|
# fill up "database.yml" with bogus entries so the redmine Gemfile will pre-install all database adapter dependencies \
|
|
echo '# the following entries only exist to force `bundle install` to pre-install all database adapter dependencies -- they can be safely removed/ignored' > ./config/database.yml && \
|
|
for adapter in mysql2 postgresql sqlserver sqlite3; do \
|
|
echo "$adapter:" >> ./config/database.yml; \
|
|
echo " adapter: $adapter" >> ./config/database.yml; \
|
|
done; \
|
|
&& bundle exec rake redmine:plugins:assets RAILS_ENV=production \
|
|
&& rm ./config/database.yml \
|
|
&& chmod +x /pre-entrypoint.sh \
|
|
# setting ENTRYPOINT destroys CMD so replace the entrypoint script and call it later \
|
|
# (see bottom note in https://docs.docker.com/engine/reference/builder/#entrypoint) \
|
|
&& mv /docker-entrypoint.sh /orig-entrypoint.sh \
|
|
&& mv /pre-entrypoint.sh /docker-entrypoint.sh \
|
|
# Apply patches \
|
|
&& git apply project_identifier.patch \
|
|
&& rm project_identifier.patch
|