diff --git a/docker-compose.yml b/docker-compose.yml index 41b845c..dc4423e 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -29,7 +29,7 @@ services: volumes: #- /etc/timezone:/etc/timezone:ro #- /etc/localtime:/etc/localtime:ro - # - ./entrypoint.sh:/entrypoint.sh # if you want to install additional Python packages, uncomment this line! + - ./entrypoint.sh:/entrypoint.sh - ./addons:/mnt/extra-addons - ./etc:/etc/odoo restart: always # run as a service diff --git a/entrypoint.sh b/entrypoint.sh index f3f2a13..dcdef5c 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -15,6 +15,17 @@ pip3 install -r /etc/odoo/requirements.txt # sed -i 's|raise werkzeug.exceptions.BadRequest(msg)|self.jsonrequest = {}|g' /usr/lib/python3/dist-packages/odoo/http.py +# Install logrotate if not already installed +if ! dpkg -l | grep -q logrotate; then + apt-get update && apt-get install -y logrotate +fi + +# Copy logrotate config +cp /etc/odoo/logrotate /etc/logrotate.d/odoo + +# Start cron daemon (required for logrotate) +cron + DB_ARGS=() function check_config() { param="$1" diff --git a/etc/logrotate b/etc/logrotate new file mode 100644 index 0000000..1ee41eb --- /dev/null +++ b/etc/logrotate @@ -0,0 +1,8 @@ +/etc/odoo/*.log { + rotate 3 + daily + nocompress + missingok + notifempty + copytruncate +}