Content
Install a custom plugin to a docker compose container
Added by Frédéric MAZUR over 1 year 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)
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:
Where
gitlab-integration
would be a folder containing theGemfile.plugins
which should look something like this:And the
Dockerfile
which should look as described in our docs too. That is like the following.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 simplebundle install
in the second to last line of the Dockerfile.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,
Small fixes.
docker-compose:
gitlab-integration/Gemfile.plugins:
gitlab-integration/Dockerfile: