Skip to content
This repository was archived by the owner on Jun 5, 2019. It is now read-only.

Commit a233c1c

Browse files
Release OpenProject 8.3.1
2 parents 276bc7c + 368c1db commit a233c1c

File tree

135 files changed

+1928
-1771
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

135 files changed

+1928
-1771
lines changed

Dockerfile

Lines changed: 49 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,74 +1,85 @@
11
FROM ruby:2.6-stretch
2+
MAINTAINER operations@openproject.com
23

3-
ENV NODE_VERSION="10.15.0"
4-
ENV BUNDLER_VERSION="2.0.1"
4+
ENV NODE_VERSION "10.15.0"
5+
ENV BUNDLER_VERSION "2.0.1"
56
ENV APP_USER app
6-
ENV APP_PATH /usr/src/app
7-
ENV APP_DATA /var/db/openproject
8-
ENV ATTACHMENTS_STORAGE_PATH /var/db/openproject/files
7+
ENV APP_PATH /app
8+
ENV APP_DATA_PATH /var/openproject/assets
9+
ENV APP_DATA_PATH_LEGACY /var/db/openproject
10+
ENV PGDATA /var/openproject/pgdata
11+
ENV PGDATA_LEGACY /var/lib/postgresql/9.6/main
12+
13+
ENV DATABASE_URL postgres://openproject:openproject@127.0.0.1/openproject
14+
ENV RAILS_ENV production
15+
ENV HEROKU true
16+
ENV RAILS_CACHE_STORE memcache
17+
ENV OPENPROJECT_INSTALLATION__TYPE docker
18+
ENV NEW_RELIC_AGENT_ENABLED false
19+
ENV ATTACHMENTS_STORAGE_PATH $APP_DATA_PATH/files
920

1021
# Set a default key base, ensure to provide a secure value in production environments!
11-
ENV SECRET_KEY_BASE=OVERWRITE_ME
22+
ENV SECRET_KEY_BASE OVERWRITE_ME
1223

1324
# install node + npm
1425
RUN curl https://nodejs.org/dist/v${NODE_VERSION}/node-v${NODE_VERSION}-linux-x64.tar.gz | tar xzf - -C /usr/local --strip-components=1
1526

1627
RUN apt-get update -qq && \
17-
DEBIAN_FRONTEND=noninteractive apt-get install -y \
18-
postgresql-client \
19-
mysql-client \
20-
sqlite \
21-
poppler-utils \
22-
unrtf \
23-
tesseract-ocr \
24-
catdoc && \
25-
apt-get clean && rm -rf /var/lib/apt/lists/*
28+
DEBIAN_FRONTEND=noninteractive apt-get install -y \
29+
postgresql-client \
30+
poppler-utils \
31+
unrtf \
32+
tesseract-ocr \
33+
catdoc \
34+
memcached \
35+
postfix \
36+
postgresql \
37+
apache2 \
38+
supervisor && \
39+
apt-get clean && rm -rf /var/lib/apt/lists/*
40+
41+
# Set up pg defaults
42+
RUN echo "host all all 0.0.0.0/0 md5" >> /etc/postgresql/9.6/main/pg_hba.conf
43+
RUN echo "listen_addresses='*'" >> /etc/postgresql/9.6/main/postgresql.conf
44+
RUN echo "data_directory='$PGDATA'" >> /etc/postgresql/9.6/main/postgresql.conf
45+
RUN rm -rf "$PGDATA_LEGACY" && rm -rf "$PGDATA" && mkdir -p "$PGDATA" && chown -R postgres:postgres "$PGDATA"
46+
RUN a2enmod proxy proxy_http && rm -f /etc/apache2/sites-enabled/000-default.conf
2647

2748
# using /home/app since npm cache and other stuff will be put there when running npm install
2849
# we don't want to pollute any locally-mounted directory
2950
RUN useradd -d /home/$APP_USER -m $APP_USER
30-
RUN mkdir -p $APP_PATH $APP_DATA
31-
RUN gem install bundler --version "${bundler_version}" --no-document
3251

3352
WORKDIR $APP_PATH
53+
RUN gem install bundler --version "${bundler_version}" --no-document
3454

3555
COPY Gemfile ./Gemfile
3656
COPY Gemfile.* ./
3757
COPY modules ./modules
3858
# OpenProject::Version is required by module versions in gemspecs
3959
RUN mkdir -p lib/open_project
4060
COPY lib/open_project/version.rb ./lib/open_project/
41-
RUN bundle install --deployment --with="docker opf_plugins" --without="test development" --jobs=8 --retry=3
42-
43-
# Then, npm install node modules
44-
COPY package.json /tmp/npm/package.json
45-
COPY frontend/*.json /tmp/npm/frontend/
46-
RUN cd /tmp/npm/frontend/ && RAILS_ENV=production npm install && mv /tmp/npm/frontend /usr/src/app/
61+
RUN bundle install --deployment --with="docker opf_plugins" --without="test development mysql2" --jobs=8 --retry=3
4762

4863
# Finally, copy over the whole thing
49-
COPY . /usr/src/app
50-
RUN mkdir $APP_PATH/tmp
51-
RUN chown -R $APP_USER:$APP_USER $APP_PATH
52-
RUN cp docker/Procfile .
53-
RUN cp packaging/conf/database.yml config/
64+
COPY . $APP_PATH
65+
5466
RUN sed -i "s|Rails.groups(:opf_plugins)|Rails.groups(:opf_plugins, :docker)|" config/application.rb
5567

5668
# Ensure we can write in /tmp/op_uploaded_files (cf. #29112)
57-
RUN mkdir -p /tmp/op_uploaded_files/
58-
RUN chown -R $APP_USER:$APP_USER /tmp/op_uploaded_files/
59-
60-
# Allow uploading avatars w/ postgres
61-
RUN chown -R $APP_USER:$APP_USER $APP_DATA
69+
RUN mkdir -p /tmp/op_uploaded_files/ && chown -R $APP_USER:$APP_USER /tmp/op_uploaded_files/
6270

6371
# Re-use packager database.yml
6472
COPY packaging/conf/database.yml ./config/database.yml
6573

6674
# Run the npm postinstall manually after it was copied
67-
RUN DATABASE_URL=sqlite3:///tmp/db.sqlite3 RAILS_ENV=production bundle exec rake assets:precompile
75+
# Then, npm install node modules
76+
RUN bash docker/precompile-assets.sh
6877

69-
# Include pandoc
70-
RUN DATABASE_URL=sqlite3:///tmp/db.sqlite3 RAILS_ENV=production bundle exec rails runner "puts ::OpenProject::TextFormatting::Formats::Markdown::PandocDownloader.check_or_download!"
78+
# ports
79+
EXPOSE 80 5432
7180

72-
CMD ["./docker/web"]
81+
# volumes to export
82+
VOLUME ["$PGDATA", "$APP_DATA_PATH"]
7383
ENTRYPOINT ["./docker/entrypoint.sh"]
74-
VOLUME ["$APP_DATA"]
84+
CMD ["./docker/supervisord"]
85+

Dockerfile.public

Lines changed: 0 additions & 39 deletions
This file was deleted.

Gemfile

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ ruby '~> 2.6.1'
3333
gem 'actionpack-xml_parser', '~> 2.0.0'
3434
gem 'activemodel-serializers-xml', '~> 1.0.1'
3535
gem 'activerecord-session_store', '~> 1.1.0'
36-
gem 'rails', '~> 5.2.2'
36+
gem 'rails', '~> 5.2.2.1'
3737
gem 'responders', '~> 2.4'
3838

3939
gem 'rdoc', '>= 2.4.2'
@@ -152,7 +152,9 @@ group :production do
152152
# we use dalli as standard memcache client
153153
# requires memcached 1.4+
154154
# see https://github.clientom/mperham/dalli
155-
gem 'dalli', '~> 2.7.6'
155+
gem 'dalli',
156+
git: 'https://github.com/petergoldstein/dalli',
157+
ref: '0ff39199b5e91c6dbdaabc7c085b81938d0f08d2'
156158

157159
# Unicorn worker killer to restart unicorn child workers
158160
gem 'unicorn-worker-killer', require: false
@@ -287,6 +289,9 @@ platforms :mri, :mingw, :x64_mingw do
287289
group :postgres do
288290
gem 'pg', '~> 1.1.0'
289291
end
292+
293+
# Support application loading when no database exists yet.
294+
gem 'activerecord-nulldb-adapter', '~> 0.3.9'
290295
end
291296

292297
group :opf_plugins do
@@ -300,8 +305,6 @@ group :docker, optional: true do
300305
gem 'health_check', require: !!ENV['HEROKU']
301306
gem 'newrelic_rpm', require: !!ENV['HEROKU']
302307
gem 'rails_12factor', require: !!ENV['HEROKU']
303-
# Require specific version of sqlite3 for rails
304-
gem 'sqlite3', '~> 1.3.6', require: false
305308
end
306309

307310
# Load Gemfile.local, Gemfile.plugins, plugins', and custom Gemfiles

0 commit comments

Comments
 (0)