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

Commit

Permalink
Release OpenProject 8.3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
oliverguenther committed Mar 15, 2019
2 parents 276bc7c + 368c1db commit a233c1c
Show file tree
Hide file tree
Showing 135 changed files with 1,928 additions and 1,771 deletions.
87 changes: 49 additions & 38 deletions Dockerfile
@@ -1,74 +1,85 @@
FROM ruby:2.6-stretch FROM ruby:2.6-stretch
MAINTAINER operations@openproject.com


ENV NODE_VERSION="10.15.0" ENV NODE_VERSION "10.15.0"
ENV BUNDLER_VERSION="2.0.1" ENV BUNDLER_VERSION "2.0.1"
ENV APP_USER app ENV APP_USER app
ENV APP_PATH /usr/src/app ENV APP_PATH /app
ENV APP_DATA /var/db/openproject ENV APP_DATA_PATH /var/openproject/assets
ENV ATTACHMENTS_STORAGE_PATH /var/db/openproject/files ENV APP_DATA_PATH_LEGACY /var/db/openproject
ENV PGDATA /var/openproject/pgdata
ENV PGDATA_LEGACY /var/lib/postgresql/9.6/main

ENV DATABASE_URL postgres://openproject:openproject@127.0.0.1/openproject
ENV RAILS_ENV production
ENV HEROKU true
ENV RAILS_CACHE_STORE memcache
ENV OPENPROJECT_INSTALLATION__TYPE docker
ENV NEW_RELIC_AGENT_ENABLED false
ENV ATTACHMENTS_STORAGE_PATH $APP_DATA_PATH/files


# Set a default key base, ensure to provide a secure value in production environments! # Set a default key base, ensure to provide a secure value in production environments!
ENV SECRET_KEY_BASE=OVERWRITE_ME ENV SECRET_KEY_BASE OVERWRITE_ME


# install node + npm # install node + npm
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 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


RUN apt-get update -qq && \ RUN apt-get update -qq && \
DEBIAN_FRONTEND=noninteractive apt-get install -y \ DEBIAN_FRONTEND=noninteractive apt-get install -y \
postgresql-client \ postgresql-client \
mysql-client \ poppler-utils \
sqlite \ unrtf \
poppler-utils \ tesseract-ocr \
unrtf \ catdoc \
tesseract-ocr \ memcached \
catdoc && \ postfix \
apt-get clean && rm -rf /var/lib/apt/lists/* postgresql \
apache2 \
supervisor && \
apt-get clean && rm -rf /var/lib/apt/lists/*

# Set up pg defaults
RUN echo "host all all 0.0.0.0/0 md5" >> /etc/postgresql/9.6/main/pg_hba.conf
RUN echo "listen_addresses='*'" >> /etc/postgresql/9.6/main/postgresql.conf
RUN echo "data_directory='$PGDATA'" >> /etc/postgresql/9.6/main/postgresql.conf
RUN rm -rf "$PGDATA_LEGACY" && rm -rf "$PGDATA" && mkdir -p "$PGDATA" && chown -R postgres:postgres "$PGDATA"
RUN a2enmod proxy proxy_http && rm -f /etc/apache2/sites-enabled/000-default.conf


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


WORKDIR $APP_PATH WORKDIR $APP_PATH
RUN gem install bundler --version "${bundler_version}" --no-document


COPY Gemfile ./Gemfile COPY Gemfile ./Gemfile
COPY Gemfile.* ./ COPY Gemfile.* ./
COPY modules ./modules COPY modules ./modules
# OpenProject::Version is required by module versions in gemspecs # OpenProject::Version is required by module versions in gemspecs
RUN mkdir -p lib/open_project RUN mkdir -p lib/open_project
COPY lib/open_project/version.rb ./lib/open_project/ COPY lib/open_project/version.rb ./lib/open_project/
RUN bundle install --deployment --with="docker opf_plugins" --without="test development" --jobs=8 --retry=3 RUN bundle install --deployment --with="docker opf_plugins" --without="test development mysql2" --jobs=8 --retry=3

# Then, npm install node modules
COPY package.json /tmp/npm/package.json
COPY frontend/*.json /tmp/npm/frontend/
RUN cd /tmp/npm/frontend/ && RAILS_ENV=production npm install && mv /tmp/npm/frontend /usr/src/app/


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


# Ensure we can write in /tmp/op_uploaded_files (cf. #29112) # Ensure we can write in /tmp/op_uploaded_files (cf. #29112)
RUN mkdir -p /tmp/op_uploaded_files/ RUN mkdir -p /tmp/op_uploaded_files/ && chown -R $APP_USER:$APP_USER /tmp/op_uploaded_files/
RUN chown -R $APP_USER:$APP_USER /tmp/op_uploaded_files/

# Allow uploading avatars w/ postgres
RUN chown -R $APP_USER:$APP_USER $APP_DATA


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


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


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


CMD ["./docker/web"] # volumes to export
VOLUME ["$PGDATA", "$APP_DATA_PATH"]
ENTRYPOINT ["./docker/entrypoint.sh"] ENTRYPOINT ["./docker/entrypoint.sh"]
VOLUME ["$APP_DATA"] CMD ["./docker/supervisord"]

39 changes: 0 additions & 39 deletions Dockerfile.public

This file was deleted.

11 changes: 7 additions & 4 deletions Gemfile
Expand Up @@ -33,7 +33,7 @@ ruby '~> 2.6.1'
gem 'actionpack-xml_parser', '~> 2.0.0' gem 'actionpack-xml_parser', '~> 2.0.0'
gem 'activemodel-serializers-xml', '~> 1.0.1' gem 'activemodel-serializers-xml', '~> 1.0.1'
gem 'activerecord-session_store', '~> 1.1.0' gem 'activerecord-session_store', '~> 1.1.0'
gem 'rails', '~> 5.2.2' gem 'rails', '~> 5.2.2.1'
gem 'responders', '~> 2.4' gem 'responders', '~> 2.4'


gem 'rdoc', '>= 2.4.2' gem 'rdoc', '>= 2.4.2'
Expand Down Expand Up @@ -152,7 +152,9 @@ group :production do
# we use dalli as standard memcache client # we use dalli as standard memcache client
# requires memcached 1.4+ # requires memcached 1.4+
# see https://github.clientom/mperham/dalli # see https://github.clientom/mperham/dalli
gem 'dalli', '~> 2.7.6' gem 'dalli',
git: 'https://github.com/petergoldstein/dalli',
ref: '0ff39199b5e91c6dbdaabc7c085b81938d0f08d2'


# Unicorn worker killer to restart unicorn child workers # Unicorn worker killer to restart unicorn child workers
gem 'unicorn-worker-killer', require: false gem 'unicorn-worker-killer', require: false
Expand Down Expand Up @@ -287,6 +289,9 @@ platforms :mri, :mingw, :x64_mingw do
group :postgres do group :postgres do
gem 'pg', '~> 1.1.0' gem 'pg', '~> 1.1.0'
end end

# Support application loading when no database exists yet.
gem 'activerecord-nulldb-adapter', '~> 0.3.9'
end end


group :opf_plugins do group :opf_plugins do
Expand All @@ -300,8 +305,6 @@ group :docker, optional: true do
gem 'health_check', require: !!ENV['HEROKU'] gem 'health_check', require: !!ENV['HEROKU']
gem 'newrelic_rpm', require: !!ENV['HEROKU'] gem 'newrelic_rpm', require: !!ENV['HEROKU']
gem 'rails_12factor', require: !!ENV['HEROKU'] gem 'rails_12factor', require: !!ENV['HEROKU']
# Require specific version of sqlite3 for rails
gem 'sqlite3', '~> 1.3.6', require: false
end end


# Load Gemfile.local, Gemfile.plugins, plugins', and custom Gemfiles # Load Gemfile.local, Gemfile.plugins, plugins', and custom Gemfiles
Expand Down

0 comments on commit a233c1c

Please sign in to comment.