noshutdown-ru / vault

Is a plugin for project management system Redmine. Allows you to store various passwords/keys in one place for the project.
https://noshutdown.ru/en/redmine-plugins-vault
46 stars 29 forks source link

Установка в docker-compose (Redmine 4.2.) #89

Closed hello-ger closed 2 years ago

hello-ger commented 2 years ago

Добрый день Пытался установить плагин на РМ 4.2+ в докере Вот окружение image

bundle install отрабатывает без ошибок Вот что пишет после миграции плагина в базу командой docker exec test_app_1 rake redmine:plugins:migrate RAILS_ENV=production

`rake aborted! LoadError: No such file to load -- iconv.rb

/usr/local/bundle/gems/activesupport-5.2.6/lib/active_support/dependencies.rb:291:in require' /usr/local/bundle/gems/activesupport-5.2.6/lib/active_support/dependencies.rb:291:inblock in require' /usr/local/bundle/gems/activesupport-5.2.6/lib/active_support/dependencies.rb:257:in load_dependency' /usr/local/bundle/gems/activesupport-5.2.6/lib/active_support/dependencies.rb:291:inrequire' /usr/src/redmine/plugins/vault/app/models/vault/key.rb:3:in <module:Vault>' /usr/src/redmine/plugins/vault/app/models/vault/key.rb:1:in<top (required)>' /usr/local/bundle/gems/activesupport-5.2.6/lib/active_support/dependencies.rb:291:in require' /usr/local/bundle/gems/activesupport-5.2.6/lib/active_support/dependencies.rb:291:inblock in require' /usr/local/bundle/gems/activesupport-5.2.6/lib/active_support/dependencies.rb:257:in load_dependency' /usr/local/bundle/gems/activesupport-5.2.6/lib/active_support/dependencies.rb:291:inrequire' /usr/src/redmine/plugins/vault/lib/vault.rb:1:in <top (required)>' /usr/local/bundle/gems/activesupport-5.2.6/lib/active_support/dependencies.rb:291:inrequire' /usr/local/bundle/gems/activesupport-5.2.6/lib/active_support/dependencies.rb:291:in block in require' /usr/local/bundle/gems/activesupport-5.2.6/lib/active_support/dependencies.rb:257:inload_dependency' /usr/local/bundle/gems/activesupport-5.2.6/lib/active_support/dependencies.rb:291:in require' /usr/local/bundle/gems/activesupport-5.2.6/lib/active_support/dependencies.rb:378:inblock in require_or_load' /usr/local/bundle/gems/activesupport-5.2.6/lib/active_support/dependencies.rb:37:in block in load_interlock' /usr/local/bundle/gems/activesupport-5.2.6/lib/active_support/dependencies/interlock.rb:14:inblock in loading' /usr/local/bundle/gems/activesupport-5.2.6/lib/active_support/concurrency/share_lock.rb:151:in exclusive' /usr/local/bundle/gems/activesupport-5.2.6/lib/active_support/dependencies/interlock.rb:13:inloading' /usr/local/bundle/gems/activesupport-5.2.6/lib/active_support/dependencies.rb:37:in load_interlock' /usr/local/bundle/gems/activesupport-5.2.6/lib/active_support/dependencies.rb:356:inrequire_or_load' /usr/local/bundle/gems/activesupport-5.2.6/lib/active_support/dependencies.rb:334:in depend_on' /usr/local/bundle/gems/activesupport-5.2.6/lib/active_support/dependencies.rb:246:inrequire_dependency' /usr/src/redmine/plugins/vault/lib/project_patch.rb:2:in <top (required)>' /usr/local/bundle/gems/activesupport-5.2.6/lib/active_support/dependencies.rb:291:inrequire' /usr/local/bundle/gems/activesupport-5.2.6/lib/active_support/dependencies.rb:291:in block in require' /usr/local/bundle/gems/activesupport-5.2.6/lib/active_support/dependencies.rb:257:inload_dependency' /usr/local/bundle/gems/activesupport-5.2.6/lib/active_support/dependencies.rb:291:in require' /usr/local/bundle/gems/activesupport-5.2.6/lib/active_support/dependencies.rb:378:inblock in require_or_load' /usr/local/bundle/gems/activesupport-5.2.6/lib/active_support/dependencies.rb:37:in block in load_interlock' /usr/local/bundle/gems/activesupport-5.2.6/lib/active_support/dependencies/interlock.rb:14:inblock in loading' /usr/local/bundle/gems/activesupport-5.2.6/lib/active_support/concurrency/share_lock.rb:151:in exclusive' /usr/local/bundle/gems/activesupport-5.2.6/lib/active_support/dependencies/interlock.rb:13:inloading' /usr/local/bundle/gems/activesupport-5.2.6/lib/active_support/dependencies.rb:37:in load_interlock' /usr/local/bundle/gems/activesupport-5.2.6/lib/active_support/dependencies.rb:356:inrequire_or_load' /usr/local/bundle/gems/activesupport-5.2.6/lib/active_support/dependencies.rb:334:in depend_on' /usr/local/bundle/gems/activesupport-5.2.6/lib/active_support/dependencies.rb:246:inrequire_dependency' /usr/src/redmine/plugins/vault/init.rb:4:in <top (required)>' /usr/local/bundle/gems/activesupport-5.2.6/lib/active_support/dependencies.rb:291:inrequire' /usr/local/bundle/gems/activesupport-5.2.6/lib/active_support/dependencies.rb:291:in block in require' /usr/local/bundle/gems/activesupport-5.2.6/lib/active_support/dependencies.rb:257:inload_dependency' /usr/local/bundle/gems/activesupport-5.2.6/lib/active_support/dependencies.rb:291:in require' /usr/src/redmine/lib/redmine/plugin.rb:187:inblock in load' /usr/src/redmine/lib/redmine/plugin.rb:178:in each' /usr/src/redmine/lib/redmine/plugin.rb:178:inload' /usr/src/redmine/config/initializers/30-redmine.rb:20:in <top (required)>' /usr/local/bundle/gems/activesupport-5.2.6/lib/active_support/dependencies.rb:285:inload' /usr/local/bundle/gems/activesupport-5.2.6/lib/active_support/dependencies.rb:285:in block in load' /usr/local/bundle/gems/activesupport-5.2.6/lib/active_support/dependencies.rb:257:inload_dependency' /usr/local/bundle/gems/activesupport-5.2.6/lib/active_support/dependencies.rb:285:in load' /usr/local/bundle/gems/railties-5.2.6/lib/rails/engine.rb:663:inblock in load_config_initializer' /usr/local/bundle/gems/activesupport-5.2.6/lib/active_support/notifications.rb:170:in instrument' /usr/local/bundle/gems/railties-5.2.6/lib/rails/engine.rb:662:inload_config_initializer' /usr/local/bundle/gems/railties-5.2.6/lib/rails/engine.rb:620:in block (2 levels) in <class:Engine>' /usr/local/bundle/gems/railties-5.2.6/lib/rails/engine.rb:619:ineach' /usr/local/bundle/gems/railties-5.2.6/lib/rails/engine.rb:619:in block in <class:Engine>' /usr/local/bundle/gems/railties-5.2.6/lib/rails/initializable.rb:32:ininstance_exec' /usr/local/bundle/gems/railties-5.2.6/lib/rails/initializable.rb:32:in run' /usr/local/bundle/gems/railties-5.2.6/lib/rails/initializable.rb:61:inblock in run_initializers' /usr/local/bundle/gems/railties-5.2.6/lib/rails/initializable.rb:50:in each' /usr/local/bundle/gems/railties-5.2.6/lib/rails/initializable.rb:50:intsort_each_child' /usr/local/bundle/gems/railties-5.2.6/lib/rails/initializable.rb:60:in run_initializers' /usr/local/bundle/gems/railties-5.2.6/lib/rails/application.rb:361:ininitialize!' /usr/src/redmine/config/environment.rb:16:in <top (required)>' /usr/local/bundle/gems/railties-5.2.6/lib/rails/application.rb:337:inrequire' /usr/local/bundle/gems/railties-5.2.6/lib/rails/application.rb:337:in require_environment!' /usr/local/bundle/gems/railties-5.2.6/lib/rails/application.rb:520:inblock in run_tasks_blocks' /usr/local/bundle/gems/rake-13.0.6/exe/rake:27:in <top (required)>' Tasks: TOP => redmine:plugins:migrate => environment (See full trace by running task with --trace)

Свежий контейнер, свежая база Пробовал переустанавливать gem'ы

iconv установлен

* iconv (1.0.8) Summary: iconv wrapper library Homepage: https://github.com/ruby/iconv Path: /usr/local/lib/ruby/gems/2.7.0/gems/iconv-1.0.8 Default Gem: yes

Подскажите, в чем может быть проблема?

lightinen commented 2 years ago

Боюсь соврать, но я контейнер 4.1 дособираю через DockerFile. Не помню точно, но по-моему тоже сталкивался с проблемой этой библиотеки и пытался долго решить, в итоге доставил пакеты для сборки и теперь все норм поднимается.

apt-get update && apt-get install -y build-essential
hello-ger commented 2 years ago

Боюсь соврать, но я контейнер 4.1 дособираю через DockerFile. Не помню точно, но по-моему тоже сталкивался с проблемой этой библиотеки и пытался долго решить, в итоге доставил пакеты для сборки и теперь все норм поднимается.

apt-get update && apt-get install -y build-essential

Спасибо за предложение Попробовал через докерфайл Билдится ок, после запуска и миграции та же лажа - LoadError: No such file to load -- iconv.rb

hello-ger commented 2 years ago

Итак, я поборол проблему.

Dockerfile:

FROM redmine:4.2
RUN apt-get update && apt-get install -y build-essential

docker-compose.yml

version: '3.1'
services:
  app:
    build:
      context: .
    restart: unless-stopped
    ports:
      - 3000:3000
    environment:
      REDMINE_DB_MYSQL: db
      REDMINE_DB_PASSWORD: $DB_PASS
    volumes:
     - ./storage/redmine-plugins:/usr/src/redmine/plugins
     - ./storage/redmine-themes:/usr/src/redmine/public/themes
     - ./storage/redmine-files:/usr/src/redmine/files
     - ./storage/redmine-config/configuration.yml:/usr/src/redmine/config/configuration.yml
  db:
    image: mysql:5.7
    restart: always
    ports:
      - 336:3306
    environment:
      MYSQL_ROOT_PASSWORD: $DB_PASS
      MYSQL_DATABASE: $DB_NAME
    command:
      - "--character-set-server=utf8mb4"
      - "--collation-server=utf8mb4_unicode_ci"
    volumes:
      - ./storage/mysql-data:/var/lib/mysql

Как поднимать: docker-compose build && docker-compose up -d docker exec redmine_app_1 rake redmine:plugins:migrate RAILS_ENV=production docker-compose restart