Open link in a new tab

Content

Expand project menu

Openproject with docker which needs to be run in sub directory

Hi,

I am trying to run openproject docker container in one of my linux instance. I want to run it in the sub directory and as per the documentation i changed the rails_relative_url_root in configuartion.yml file.

So i tried passing this as a variable while running docker container and the value was not changed. So i brought up the container and then tried to change the rails_relative_url_root value in configuration.yaml file.

Tried all possible way but i am unable to run openproject in any of the sub directory.

Could someone please suggest as to how this could be achieved?

Regards,

Amrutha

Message actions

Hi,

Could anyone provide some inputs on this if possible?

Regards,

Amrutha

Message actions

Hi Amrutha,

you can theoretically set the OPENPROJECT_RAILS__RELATIVE__URL__ROOT variable which controls the internal server to run in a subdirectory. However whenever doing that, assets will need to be recompiled which is going to be difficult in the docker container. You could base a custom container on ours, set the environment and run bundle exec rails assets:precompile

Best,

Oliver

Message actions

So as per the above suggestion, we need to create another container taking your official image as a build a new container out of it keeping OPENPROJECT_RAILS__RELATIVE__URL__ROOT?

Please correct me if my understanding is wrong?

Message actions

Hi,

I just ran the below docker command to bring up the container and then i went inside the container and tried to compile with the above mentioned command and was getting the below error

Linking frontend plugins

hook registered

Cleaning linked target directory /app/frontend/src/app/modules/plugins/linked

Linking frontend of OpenProject plugin openproject-avatars to /app/frontend/src/app/modules/plugins/linked/openproject-avatars.

Linking frontend of OpenProject plugin openproject-costs to /app/frontend/src/app/modules/plugins/linked/openproject-costs.

Linking frontend of OpenProject plugin openproject-documents to /app/frontend/src/app/modules/plugins/linked/openproject-documents.

Regenerating frontend plugin registry /app/frontend/src/app/modules/plugins/linked-plugins.module.ts.

Building angular frontend

npm run build

> openproject-frontend@0.1.0 prebuild /app/frontend

> ./scripts/link_plugin_placeholder.js

> openproject-frontend@0.1.0 build /app/frontend

> ng build --prod

sh: 1: ng: not found

npm ERR! file sh

npm ERR! code ELIFECYCLE

npm ERR! errno ENOENT

npm ERR! syscall spawn

npm ERR! openproject-frontend@0.1.0 build: `ng build --prod`

npm ERR! spawn ENOENT

npm ERR!

npm ERR! Failed at the openproject-frontend@0.1.0 build script.

npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm WARN Local package.json exists, but node_modules missing, did you mean to install?

npm ERR! A complete log of this run can be found in:

npm ERR!     /root/.npm/_logs/2019-09-26T05_31_36_110Z-debug.log

rails aborted!

Failed to compile angular frontend: 1

/app/lib/tasks/assets.rake:66:in `block (4 levels) in <top (required)>'

/app/lib/tasks/assets.rake:65:in `block (3 levels) in <top (required)>'

/app/lib/tasks/assets.rake:64:in `chdir'

/app/lib/tasks/assets.rake:64:in `block (2 levels) in <top (required)>'

/app/vendor/bundle/ruby/2.6.0/gems/railties-5.2.2.1/lib/rails/commands/rake/rake_command.rb:23:in `block in perform'

/app/vendor/bundle/ruby/2.6.0/gems/railties-5.2.2.1/lib/rails/commands/rake/rake_command.rb:20:in `perform'

/app/vendor/bundle/ruby/2.6.0/gems/railties-5.2.2.1/lib/rails/command.rb:48:in `invoke'

/app/vendor/bundle/ruby/2.6.0/gems/railties-5.2.2.1/lib/rails/commands.rb:18:in `<top (required)>'

bin/rails:9:in `require'

bin/rails:9:in `<main>'

Tasks: TOP => assets:precompile => assets:compile_environment => assets:prepare_op => assets:angular

(See full trace by running task with --trace)

Message actions

Hi,

Could someone please help on this issue as we are stuck with this from past 2 weeks.

Message actions

Hi Oliver Günther,

could someone please help us out with this issue?

Message actions

Hi Team,

Could you please help out with this issue as I am stuck from past 2 weeks on this.

Regards,
Amrutha

Message actions

I would recommend to use the regular packaged installation which allows you to set a relative URL root in the configuration process. It will be easier to maintain than with the docker setup

Best,

Oliver

Message actions

Hi,

Our requirement is to use a docker image since we are running open project in a kubernertes cluster.

Regards,
Amrutha


Message actions

Hi Team,

Any update on this issue?

Regards,
Amrutha