Git Product home page Git Product logo

Comments (16)

sameersbn avatar sameersbn commented on July 2, 2024

@b-a-t will do.

from docker-redmine.

elderone avatar elderone commented on July 2, 2024

VOLUME please

from docker-redmine.

b-a-t avatar b-a-t commented on July 2, 2024

I also wanted to ask for the ability to mount /var/log as a volume from outside. Correct me, if I'm wrong - that would imply, that in /app/init we need to (re)create sub-directories with-in /var/log and set proper permissions on them.

from docker-redmine.

sameersbn avatar sameersbn commented on July 2, 2024

@elderone Its difficult to VOLUME mount /var/log. However I will make sure /var/log/redmine can be volume mounted.

from docker-redmine.

sameersbn avatar sameersbn commented on July 2, 2024

@b-a-t It would be a headache to handle volume mounting /var/log. re-creating required directories and correcting their permissions would be terrible.

from docker-redmine.

sameersbn avatar sameersbn commented on July 2, 2024

@b-a-t @elderone I will give it a shot though. From first glance looks like only /var/log/nginx, /var/log/supervisor and /var/log/redmine would need to be handled. I am not sure though.

from docker-redmine.

elderone avatar elderone commented on July 2, 2024

@sameersbn /var/log/redmine is very nice!
@b-a-t docker cp sameersbn/redmine:/var/log .

from docker-redmine.

b-a-t avatar b-a-t commented on July 2, 2024

I'm really new to docker(basically, only last week spent on making docker-redmine to fit my needs:)) so, possibly I'm not clear with what [VOLUME] does. What I want to be able to do is to launch application like:
docker run -v /var/log:/var/log ... and get redmine and related logs on the hosting server(or, in another container with elastic-search). From that prospective I'd expect /app/init just to be on a safe side to issue smth. like:
mkdir -p /var/log/redmine && chmod 0755 /var/log/redmine && chown redmine:redmine /var/log/redmine

And the same for nginx/ and supervisor/ with the exception that they should be happy with default root:root.

Again, I'm new to this, so maybe I'm missing some core obstacle.

from docker-redmine.

b-a-t avatar b-a-t commented on July 2, 2024

While we are on permissions, I think, this should also be fixed:
drwxr-x--- 2 www-data adm 4096 Oct 16 22:54 /var/log/nginx
We start nginx as root and then setuid to redmine - at no step we are www-data. So, I'd suggest to chown redmine /var/log/nginx to be consistent. /var/lib/nginx seems to be OK already:

 ls -l /var/lib/nginx
total 20
drwx------ 2 redmine root 4096 Oct 16 22:54 body
drwx------ 2 redmine root 4096 Oct 16 22:54 fastcgi
drwx------ 2 redmine root 4096 Oct 16 22:54 proxy
drwx------ 2 redmine root 4096 Oct 16 22:54 scgi
drwx------ 2 redmine root 4096 Oct 16 22:54 uwsgi

Not sure, maybe dpkg-statoverride --add redmine adm 0750 /var/log/nginx before adding nginx would be better idea..

from docker-redmine.

sameersbn avatar sameersbn commented on July 2, 2024

@b-a-t @elderone

I am thinking of collecting all the logs in /var/log/redmine. The following logs are of interest to us:

redmine:

  • production.log
  • unicorn.stdout.log
  • unicorn.stderr.log

nginx:

  • redmine_access.log
  • redmine_error.log

supervisor:

  • cron.log
  • nginx.log
  • supervisord.log
  • unicorn.log

I intend to collect these at the following subdirs

  • /var/log/redmine/redmine
  • /var/log/redmine/nginx
  • /var/log/redmine/supervisor

The user will be able to volume mount the /var/log/redmine/ directory.

Using this scheme we can create a data container for all the redmine logs,

docker run -it --name=redmine-logs_data \
-v /opt/redmine/logs:/var/log/redmine \
busybox true

And then import the logs volume into the redmine container like so,

docker run -it --name redmine [options] \
--volumes-from=redmine-logs_data \
sameersbn/redmine:latest

Now if you wanted to pump out these logs to logstash, all you would need to do is import the logs volume into your logstash container.

from docker-redmine.

elderone avatar elderone commented on July 2, 2024

great! thank you!

from docker-redmine.

b-a-t avatar b-a-t commented on July 2, 2024

Thanks a lot, seems to work fine!

from docker-redmine.

b-a-t avatar b-a-t commented on July 2, 2024

Sorry for bothering you with this one again. I've just noticed, that supervisord.log still remains in /var/log/supervisor. Can you, please, also move it into /var/log/redmine/supervisor?

Also access.log and error.log remain in /var/log/nginx. Not sure, how useful they are, but for consistency...

from docker-redmine.

sameersbn avatar sameersbn commented on July 2, 2024

@b-a-t I did not think supervisord.log would be of any use. But no problem, I will move it.

The nginx access.log and error.log will always be empty, you will never have any logs in them.

from docker-redmine.

b-a-t avatar b-a-t commented on July 2, 2024

@sameersbn Thanks a lot! supervisord.log is handy, when trying to figure out why something goes wrong. Was helpful to me, when nginx didn't start due not expanded REDMINE_HTTPS_HSTS_MAXAGE.

from docker-redmine.

sameersbn avatar sameersbn commented on July 2, 2024

@b-a-t supervisord.log and the nginx access and error logs have now been moved to the logs volume.

from docker-redmine.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.