1
- FROM ruby:2.7-slim-buster
1
+ FROM node:16-bullseye-slim as gtt-builder
2
+
3
+ WORKDIR /app
4
+
5
+ COPY plugins/redmine_gtt/ ./redmine_gtt/
6
+
7
+ RUN apt update; \
8
+ apt install -y git; \
9
+ cd redmine_gtt; \
10
+ yarn; \
11
+ yarn webpack
12
+
13
+ FROM ruby:3.1-slim-bullseye as base
2
14
3
15
# explicitly set uid/gid to guarantee that it won't change in the future
4
16
# the values 999:999 are identical to the current user/group id assigned
@@ -8,6 +20,7 @@ RUN set -eux; \
8
20
apt-get update; \
9
21
apt-get install -y --no-install-recommends \
10
22
ca-certificates \
23
+ curl \
11
24
wget \
12
25
\
13
26
# bzr \
@@ -21,8 +34,6 @@ RUN set -eux; \
21
34
ghostscript \
22
35
gsfonts \
23
36
imagemagick \
24
- # https://github.com/docker-library/ruby/issues/344
25
- shared-mime-info \
26
37
# grab gosu for easy step-down from root
27
38
gosu \
28
39
# grab tini for signal processing and zombie killing
@@ -44,89 +55,57 @@ RUN set -eux; \
44
55
chown redmine:redmine "$HOME" ; \
45
56
chmod 1777 "$HOME"
46
57
47
- ARG REDMINE_VERSION="4.2.3 "
48
- ARG REDMICA_VERSION= ""
49
- # ENV REDMINE_DOWNLOAD_SHA256 ad4109c3425f1cfe4c8961f6ae6494c76e20d81ed946caa1e297d9eda13b41b4
58
+ ENV REDMINE_VERSION="5.0.0 "
59
+ ENV REDMINE_DOWNLOAD_URL https://www.redmine.org/releases/redmine-5.0.0.tar.gz
60
+ ENV REDMINE_DOWNLOAD_SHA256 7e840dec846646dae52fff5c631b135d1c915d6e03ea6f01ca8f12ad35803bef
50
61
51
62
RUN set -eux; \
52
- if [ -n "$REDMINE_VERSION" ]; then \
53
- wget -O redmine.tar.gz "https://www.redmine.org/releases/redmine-${REDMINE_VERSION}.tar.gz" ; \
54
- # echo "$REDMINE_DOWNLOAD_SHA256 *redmine.tar.gz" | sha256sum -c -;
55
- elif [ -n "$REDMICA_VERSION" ]; then \
56
- wget -O redmine.tar.gz "https://github.com/redmica/redmica/archive/v${REDMICA_VERSION}.tar.gz" ; \
57
- fi; \
63
+ # if we use wget here, we get certificate issues (https://github.com/docker-library/redmine/pull/249#issuecomment-984176479)
64
+ curl -fL -o redmine.tar.gz "$REDMINE_DOWNLOAD_URL" ; \
65
+ echo "$REDMINE_DOWNLOAD_SHA256 *redmine.tar.gz" | sha256sum -c -; \
58
66
tar -xf redmine.tar.gz --strip-components=1; \
59
67
rm redmine.tar.gz files/delete.me log/delete.me; \
60
- mkdir -p log public/plugin_assets sqlite tmp/pdf tmp/pids; \
68
+ mkdir -p log public/plugin_assets tmp/pdf tmp/pids; \
61
69
chown -R redmine:redmine ./; \
62
- # log to STDOUT (https://github.com/docker-library/redmine/issues/108)
63
- echo 'config.logger = Logger.new(STDOUT)' > config/additional_environment.rb; \
64
70
# fix permissions for running as an arbitrary user
65
- chmod -R ugo=rwX config db sqlite ; \
71
+ chmod -R ugo=rwX config; \
66
72
find log tmp -type d -exec chmod 1777 '{}' +
67
73
68
- # for Redmine patches
69
- ARG PATCH_STRIP=1
70
- ARG PATCH_DIRS= ""
71
- COPY patches / ./patches /
74
+ # GTT plugin
75
+ COPY --from=gtt-builder --chown=redmine:redmine /app/ ./plugins/
76
+
77
+ COPY --chown=redmine:redmine config / ./config /
72
78
73
- # for GTT gem native extensions
74
- ARG GEM_PG_VERSION="1.2.3"
75
- COPY Gemfile.local ./
76
- COPY plugins/ ./plugins/
79
+ COPY --chown=redmine:redmine Gemfile.local ./
80
+
81
+ # Other plugins
82
+ COPY --chown=redmine:redmine plugins/redmine_gtt_smash/ ./plugins/redmine_gtt_smash/
83
+ COPY --chown=redmine:redmine plugins/redmine_text_blocks/ ./plugins/redmine_text_blocks/
84
+
85
+ # Themes (if exists)
86
+ COPY --chown=redmine:redmine public/themes/ ./public/themes/
87
+
88
+ FROM base
77
89
78
90
RUN set -eux; \
79
91
\
80
92
savedAptMark="$(apt-mark showmanual)" ; \
81
93
apt-get update; \
82
94
apt-get install -y --no-install-recommends \
95
+ # default-libmysqlclient-dev \
83
96
# freetds-dev \
84
97
gcc \
85
- # libmariadbclient-dev \
86
98
libpq-dev \
87
99
# libsqlite3-dev \
88
100
make \
89
101
patch \
90
- # in 4.1+, libmagickcore-dev and libmagickwand-dev are no longer necessary/used: https://www.redmine.org/issues/30492
91
- libmagickcore-dev libmagickwand-dev \
92
102
# for GTT dependencies
93
- g++ \
94
103
libgeos-dev \
95
- curl \
96
104
; \
97
105
rm -rf /var/lib/apt/lists/*; \
98
106
\
99
- if [ -n "$PATCH_DIRS" ]; then \
100
- for dir in $(echo $PATCH_DIRS | sed "s/,/ /g" ); do \
101
- for file in ./patches/"$dir" /*; do \
102
- patch -p"$PATCH_STRIP" < $file; \
103
- done; \
104
- done; \
105
- rm -rf ./patches/*; \
106
- fi; \
107
- curl -sL https://deb.nodesource.com/setup_14.x | bash -; \
108
- apt-get install -y --no-install-recommends nodejs; \
109
- curl -sL https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -; \
110
- echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list; \
111
- apt-get update; \
112
- apt-get install -y --no-install-recommends yarn; \
113
- for plugin in ./plugins/*; do \
114
- if [ -f "$plugin/webpack.config.js" ]; then \
115
- cd "$plugin" && yarn && npx webpack && rm -rf node_modules && cd ../..; \
116
- fi; \
117
- done; \
118
- export GEM_PG_VERSION="$GEM_PG_VERSION" ; \
119
107
gosu redmine bundle config --local without 'development test' ; \
120
- # fill up "database.yml" with bogus entries so the redmine Gemfile will pre-install all database adapter dependencies
121
- # https://github.com/redmine/redmine/blob/e9f9767089a4e3efbd73c35fc55c5c7eb85dd7d3/Gemfile#L50-L79
122
- 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; \
123
- # for adapter in mysql2 postgresql sqlserver sqlite3; do \
124
- for adapter in postgis; do \
125
- echo "$adapter:" >> ./config/database.yml; \
126
- echo " adapter: $adapter" >> ./config/database.yml; \
127
- done; \
128
108
gosu redmine bundle install --jobs "$(nproc)" ; \
129
- rm ./config/database.yml; \
130
109
# fix permissions for running as an arbitrary user
131
110
chmod -R ugo=rwX Gemfile.lock "$GEM_HOME" ; \
132
111
rm -rf ~redmine/.bundle; \
@@ -145,7 +124,6 @@ RUN set -eux; \
145
124
; \
146
125
apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false
147
126
148
- COPY config/ ./config/
149
127
VOLUME /usr/src/redmine/files
150
128
151
129
COPY docker-entrypoint.sh /
0 commit comments