Comments (9)
Quick addition on my previous command so that you don't have to run it once with no CMD
.
# not sure on moving RAILS_ENV to an environment variable, but I was assuming it would be needed for passenger as well
environment:
- RAILS_ENV=production
command:
- /bin/sh
- -ec
- |
/docker-entrypoint.sh rake db:migrate
/docker-entrypoint.sh rake tmp:cache:clear tmp:sessions:clear
/docker-entrypoint.sh rake redmine:plugins NAME=redmine_agile
/docker-entrypoint.sh passenger start
from redmine.
Suggestion: do not mount the plugins directory. You can also use gosu to run a command as the redmine user. I'm also not fond of not running the container as an unprivileged user.
from redmine.
Hi, did you find any solution to install plugin on your redmine container ?
Actually, i just mount a volume on plugins dir and add it manually, connect to the container redmine and execute the commands (redmine_agile plugin for example) :
bundle install --without development test --no-deployment
bundle exec rake redmine:plugins NAME=redmine_agile RAILS_ENV=production
I tried this in the docker-compose :
command:
- /bin/sh
- -c
- |
bundle exec rake tmp:cache:clear tmp:sessions:clear RAILS_ENV=production
bundle exec rake redmine:plugins NAME=redmine_agile RAILS_ENV=production
/docker-entrypoint.sh passenger start
But i got an error on /usr/src/redmine/db/schema.rb :
Errno::EACCES: Permission denied @ rb_sysopen
I can see there is a rights problem on the file, but it seems to exist only when docker-entrypoint.sh is executed.
Edit: ok there is an existing issue for that #10
from redmine.
@tiryu, the entrypoint script drops down from root to the redmine user when it starts passenger (after it creates the config/database.yml
and ensures the db:migrate
is run); most likely your two rakes create a file as root and then the passenger process cannot access it. I think the easiest solution is to just prefix your commands with the entrypoint. Any rake
task will ensure the database.yml exists and then drop to the correct user for the task.
# not sure on moving RAILS_ENV to an environment variable, but I was assuming it would be needed for passenger as well
environment:
- RAILS_ENV=production
command:
- /bin/sh
- -ec
- |
/docker-entrypoint.sh rake tmp:cache:clear tmp:sessions:clear
/docker-entrypoint.sh rake redmine:plugins NAME=redmine_agile
/docker-entrypoint.sh passenger start
You could also just use gosu
to ensure it is the proper user gosu redmine rake tmp:cache:clear tmp:sessions:clear
from redmine.
@yosifkit I've got an issue about this.
I can do that only if i ran once time at least, the image with no list of commands. Passenger has to start alone to init creation and migrate tables needed for redmine. And after, i can change my compose with the list of commands you said.
If i want the process of the entrypoint to create normally the database.yml, I need to declare in environment section of compose : POSTGRES_ENV_POSTGRES_USER to set the good user.
The variable REDMINE_DB_USER seems not to be sufficient (cause error launched by container db : User "postgres" has no password assigned.) redmine is my user by default.
Maybe you have an idea on these ?
Edit : okay it's my fault for the environment problem, it was REDMINE_DB_USERNAME and not REDMINE_DB_USER, sorry.
from redmine.
@kilass Don't suppose you found a solution to this?
from redmine.
@aogilvie the solution posted above your comment by @yosifkit in #37 (comment) is probably the best it's going to get
Since the original issue appears to have a reasonable solution in #37 (comment), I'm going to close. 👍
from redmine.
Hmm i don't use docker compose so not sure what to do here.
from redmine.
@aogilvie, it would just be the same as my previous comment, but say on a docker run
line:
$ docker run -d [other-docker-args-like-env-vars] redmine:3.4 /bin/sh -exc '
/docker-entrypoint.sh rake db:migrate
/docker-entrypoint.sh rake tmp:cache:clear tmp:sessions:clear
/docker-entrypoint.sh rake redmine:plugins NAME=redmine_agile
/docker-entrypoint.sh passenger start
'
from redmine.
Related Issues (20)
- RAILS_ENV=development supposed to work? HOT 5
- Plugins error in swarm
- Enable HTTPS without passenger HOT 2
- No 4.2.11 image HOT 4
- Image for Redmine 5.1 HOT 3
- ThreadError: can't create Thread: Operation not permitted HOT 1
- podman-compose - Mysql2::Error::ConnectionError: Unknown server host 'db' (-2) HOT 3
- Failed check after upgrade to Redmine 5.1.1
- Can't run the latest version(5.1.1) container on synology nas HOT 2
- Recommendation for Production Redmine install is to use Sidekiq (for Redis) HOT 5
- Can't manage to add redmine plugins into the Redmine 5.1.2 image
- column roles.default_time_entry_activity_id does not exist HOT 1
- Redmine Multicore
- Set transaction isolation level in config/database.yml HOT 2
- Allow 'instance' parameter in database.yml to be set via environment variable HOT 2
- SQL Server: Determine port of named instance using SQL Server Browser HOT 2
- bigdecimal - Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
- Error adding plugin "An error occurred while installing bigdecimal (3.1.8), and Bundler cannot"
- After upgrade: Container does not start, if plugins are installed with native extensions HOT 2
- Failed to build gem native extension You have to install development tools first HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from redmine.