grocy / grocy-docker

ERP beyond your fridge - now containerized - this is the docker repo of https://github.com/grocy/grocy
MIT License
418 stars 120 forks source link

Remove Hardcoded VOLUME in Frontend Dockerfile for Nginx #189

Closed RedlineTriad closed 2 years ago

RedlineTriad commented 2 years ago

In the Dockerfile for the frontend Nginx container, it hardcodes a volume for access logs: https://github.com/grocy/grocy-docker/blob/fba66410274169ffc1b59c74b520ea6da1e34cc1/Containerfile-frontend#L54

I want to run this myself, and I configured the container to log to stdout instead, since that is best practice for containers:

error_log /dev/stdout info;

http {
  access_log /dev/stdout;
}
I also did this for the backend btw
/etc/php8/php-fpm.d/z-php-fpm.conf
[global] error_log = /proc/self/fd/2

However, since it is configured in the Dockerfile, there is no way to disable the creation of a volume. If I don't mount anything there it just creates it as an anonymous volume, which is very annoying.

I would be willing to create a PR for this.

RedlineTriad commented 2 years ago

In general I would be really glad if logging exclusively used standard out, since otherwise you have to worry about log rotation, and log ingestion becomes way harder.

jayaddison commented 2 years ago

Sure, that makes sense - logging to stdout/stderr for containers does seem fairly standard, and fewer volumes to manage is generally going to result in a simpler system to operate.

It seems like there could be some competing requests at some point (for example, people requesting a way to backup logs) -- more information about use cases could be valuable if & when that happens.

I would be willing to create a PR for this.

That'd be welcome, thank you.

RedlineTriad commented 2 years ago

Just for confirmation, I would just be doing a PR to remove the VOLUME, and would create a separate issue for stdout logging.