mirror of
https://github.com/0xJacky/nginx-ui.git
synced 2026-04-25 08:45:58 +03:00
[GH-ISSUE #255] Add logrotate to docker container #4565
Labels
No labels
Q/A
bug
casdoor
dependencies
docker
documentation
duplicate
enhancement
help wanted
invalid
lego
platform:openwrt
platform:windows
pull-request
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/nginx-ui#4565
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @DjSni on GitHub (Jan 14, 2024).
Original GitHub issue: https://github.com/0xJacky/nginx-ui/issues/255
Originally assigned to: @0xJacky on GitHub.
Hello,
I have mounted the logs of nginx via a volume, because crouwdsec has to read them and I can also have a look from time to time even if the docker container is off.
I noticed that my logs have become almost 1GB in size in the meantime.
I think it would be good if the logrotate service is installed in the docker container.
Since nginx already provides the corresponding configs, nothing else needs to be set up.
Greetings
@jearton commented on GitHub (Feb 19, 2024):
The log rotation is already configured in the
/etc/logrotate.d/nginxfile within docker container.Reference tutorial: https://www.digitalocean.com/community/tutorials/how-to-configure-logging-and-log-rotation-in-nginx-on-an-ubuntu-vps#log-rotation-with-logrotate
@DjSni commented on GitHub (Feb 19, 2024):
But not installed.
@jearton commented on GitHub (Feb 20, 2024):
I got it. So now we can only enter the container and install it.
@DjSni commented on GitHub (Feb 20, 2024):
Ohh stupid, unfortunately it's not that easy since logrotate requires cron, this would also have to be installed.
This would only make the image unnecessarily larger, but 0xJacky could trigger it via the internal cron of nginx-ui, I just don't know how time-consuming that would be.
PS: it can be executed manually via
logrotate /etc/logrotate.d/nginx.@0xJacky commented on GitHub (Feb 20, 2024):
Ok, I plan to add this command into gocron, maybe later this week.
@DjSni commented on GitHub (Feb 20, 2024):
cool :) but don't forget you still have to install logrotate in the docker image.
@jearton commented on GitHub (Feb 20, 2024):
Recommended configuration about postrotate:
@0xJacky commented on GitHub (Feb 25, 2024):
Hi,
This feature has been added in v2.0.0-beta.18, please note that you have to pull the lastest nginx-ui image from dockerhub, or you can maually install logrotate via apt in current container before upgrading nginx-ui.
If you find any problem about this feature, please reply to this issue, thanks.