Top Menu

Jump to content
Home
    Modules
      • Projects
      • Activity
      • Work packages
      • Gantt charts
      • Calendars
      • Team planners
      • Boards
      • News
    • Getting started
    • Introduction video
      Welcome to OpenProject Community
      Get a quick overview of project management and team collaboration with OpenProject. You can restart this video from the help menu.

    • Help and support
    • Upgrade to Enterprise edition
    • User guides
    • Videos
    • Shortcuts
    • Community forum
    • Enterprise support

    • Additional resources
    • Data privacy and security policy
    • Digital accessibility (DE)
    • OpenProject website
    • Security alerts / Newsletter
    • OpenProject blog
    • Release notes
    • Report a bug
    • Development roadmap
    • Add and edit translations
    • API documentation
  • Sign in
      Forgot your password?

      or sign in with your existing account

      Google

Side Menu

  • Overview
  • Activity
    Activity
  • Roadmap
  • Work packages
    Work packages
  • Gantt charts
    Gantt charts
  • Calendars
    Calendars
  • Team planners
    Team planners
  • Boards
    Boards
  • News
  • Forums

Content

Plugins
  1. OpenProject
  2. Forums
  3. Plugins
  4. Install a custom plugin to a docker compose container

Install a custom plugin to a docker compose container

Added by Frédéric MAZUR about 2 years ago

Hello all,

I want to install a custom plugin on a openproject based on a "docker compose" installation, but I don't find how to do this inside the openproject documentation.

Here is the plugin that I want to install : https://github.com/btey/openproject-gitlab-integration

And I follow the documentation here :  https://www.openproject.org/docs/installation-and-operations/installation/docker/#openproject-plugins

I did not understand If I was able to modify the current "docker compose" installation of my openproject instance to add a plugin or if I have to create a new docker image myself , and integrate manually the openproject version, the postgresql image and my plugin ( and any other plugins that I could test ). I am not familiar with docker , all that I have done is install openproject with the documentation that explain the "docker compose" method

Part to get deployment from repository

  • git clone https://github.com/opf/openproject-deploy --depth=1 --branch=stable/12 openproject

Part to install a more recent docker version ( I am using debian 10 linux ):

  • apt install ca-certificates curl gnupg lsb-release
  • mkdir -m 0755 -p /etc/apt/keyrings
  • curl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
  • echo   "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian  $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
  • apt update
  • apt install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

And then, just install and run with :

  • docker compose pull
  • OPENPROJECT_HTTPS=false OPENPROJECT_HOST__NAME=xxx.xxx.com:8080 docker compose up -d

What is the best way to add a plugin on my current "docker compose" based installation ?

Best regards,

F. MAZUR.


Replies (3)

RE: Install a custom plugin to a docker compose container - Added by Markus Kahl about 2 years ago

Hey,

to use your own plugin you will have to adjust the docker-compose file. Specifically these two lines.
You can change the definition so that your own image is built as seen in the docker docs.

So in your case you might want to change these lines to:

x-op-image: &image
  image: my-openproject-with-gitlab
  build:
    context: gitlab-integration

Where gitlab-integration would be a folder containing the Gemfile.plugins which should look something like this:

group :opf_plugins do
  gem "openproject-gitlab", git: "https://github.com/btey/openproject-gitlab-integration.git", branch: "master"
end

And the Dockerfile which should look as described in our docs too. That is like the following.

FROM openproject/community:12

# If installing a local plugin (using `path:` in the `Gemfile.plugins` above),
# you will have to copy the plugin code into the container here and use the
# path inside of the container. Say for `/app/vendor/plugins/openproject-slack`:
# COPY /path/to/my/local/openproject-slack /app/vendor/plugins/openproject-slack

COPY Gemfile.plugins /app/

# If the plugin uses any external NPM dependencies you have to install them here.
# RUN npm add npm <package-name>*

RUN bundle config unset deployment && bundle install && bundle config set deployment 'true'
RUN ./docker/prod/setup/postinstall.sh

In the docs for the plugin it says you have to use bundle install --deployment --without mysql2 sqlite development test therubyracer docker so you may have to do that instead of a simple bundle install in the second to last line of the Dockerfile.

RE: Install a custom plugin to a docker compose container - Added by Frédéric MAZUR about 2 years ago

Hello,

Thank you for your answer. 

I was able to add the custom plugin with your help, I have just kept "image: openproject/community:${TAG:-12}" because with my-openproject-with-gitlab it did not work ( I guess that I should do a fork of the openproject, I prefer keep the original path , I have no modification, I just wanted to add a plugin ).

I needed to rebuild with docker compose build and I was a little bit afraid because it took 10min , and I saw that it recreated the database, I was wondering that I will have lost all the data inside database. But no, all has been kept, I just have to restart ( docker compose stop / docker compose up -d ) to see that the plugin is now available.

Now I have to see how to use this plugin, it is not exactly what I expected... Another question, now I have this plugin, what happens if I export the database with the backup feature, and I reimport on a fresh install without the plugin ? Will it work ? I am afraid it won't

I see that the gitlab integration is in the roadmap : https://community.openproject.org/projects/openproject/work_packages/23673/activity ( version 13.1.0 ) maybe I better should wait ?

Regards,

RE: Install a custom plugin to a docker compose container - Added by Vincent Hindriksen over 1 year ago

Small fixes.

docker-compose:

x-op-image: &image
  image: my-openproject-with-gitlab
   build:
     context: gitlab-integration
    args:
      TAG: "${TAG:-13}"

gitlab-integration/Gemfile.plugins:

group :opf_plugins do
  gem "openproject-gitlab_integration", git: "https://github.com/btey/openproject-gitlab-integration.git", branch: "master"
end

gitlab-integration/Dockerfile:

ARG TAG
FROM openproject/community:$TAG

# If installing a local plugin (using `path:` in the `Gemfile.plugins` above),
# you will have to copy the plugin code into the container here and use the
# path inside of the container. Say for `/app/vendor/plugins/openproject-slack`:
# COPY /path/to/my/local/openproject-slack /app/vendor/plugins/openproject-slack

COPY Gemfile.plugins /app/

# If the plugin uses any external NPM dependencies you have to install them here.
# RUN npm add npm <package-name>*

RUN bundle config unset deployment && bundle install && bundle config set deployment 'true'
RUN ./docker/prod/setup/postinstall.sh
  • (1 - 3/3)
Loading...