Logrotate on etc/odoo-server.log (#13)
* logrotate * chmod +x entrypoint.sh
This commit is contained in:
parent
c7579c53b1
commit
0511e21c4c
@ -29,7 +29,7 @@ services:
|
|||||||
volumes:
|
volumes:
|
||||||
#- /etc/timezone:/etc/timezone:ro
|
#- /etc/timezone:/etc/timezone:ro
|
||||||
#- /etc/localtime:/etc/localtime: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
|
- ./addons:/mnt/extra-addons
|
||||||
- ./etc:/etc/odoo
|
- ./etc:/etc/odoo
|
||||||
restart: always # run as a service
|
restart: always # run as a service
|
||||||
|
|||||||
11
entrypoint.sh
Normal file → Executable file
11
entrypoint.sh
Normal file → Executable file
@ -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
|
# 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=()
|
DB_ARGS=()
|
||||||
function check_config() {
|
function check_config() {
|
||||||
param="$1"
|
param="$1"
|
||||||
|
|||||||
8
etc/logrotate
Normal file
8
etc/logrotate
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
/etc/odoo/*.log {
|
||||||
|
rotate 3
|
||||||
|
daily
|
||||||
|
nocompress
|
||||||
|
missingok
|
||||||
|
notifempty
|
||||||
|
copytruncate
|
||||||
|
}
|
||||||
2
run.sh
2
run.sh
@ -43,6 +43,8 @@ fi
|
|||||||
find $DESTINATION -type f -exec chmod 644 {} \;
|
find $DESTINATION -type f -exec chmod 644 {} \;
|
||||||
find $DESTINATION -type d -exec chmod 755 {} \;
|
find $DESTINATION -type d -exec chmod 755 {} \;
|
||||||
|
|
||||||
|
chmod +x $DESTINATION/entrypoint.sh
|
||||||
|
|
||||||
# Run Odoo
|
# Run Odoo
|
||||||
docker-compose -f $DESTINATION/docker-compose.yml up -d
|
docker-compose -f $DESTINATION/docker-compose.yml up -d
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user