-
I installed a docker with baikal on a raspberry pi. I used Baikal server as a rest api. When querying the baikal server, disk space began to decrease. After a more detailed examination, I found that the files from the session php remain in the docker container - directory: /var/lib/docker/overlay2/3cd91b16159dc6baa381e6963f3f0e9fb5c45d69314afa5b592f8335579e04d3/merged/var/lib/php/sessions But I don't think that's an ok solution. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hi @Dantyk , following https://stackoverflow.com/questions/654310/cleanup-php-session-files, it looks like this session behaviour can/should be fine-tuned in a If I were to do it on my server, I would
I'm not familiar enough with PHP to give advice on which session settings make sense, but the Baikal maintainers/community at https://github.com/sabre-io/Baikal might be able to help. That all said, if you want to stick with deleting the files (which may cause issues if you delete files of active sessions), I would run the command inside the container: # Find the container id. If you have a fixed name, you can of course just use that.
container_id=$(docker ps --filter "ancestor=ckulka/baikal" --quiet)
# Run command inside the container to delete PHP session files
/usr/bin/docker exec -it $container_id find /var/lib/php/sessions -type f -delete I find it a bit cleaner and you should have fewer file permission issues. Well, assuming you don't already run it as root, which we all say we never do (for the usual reasons), but end up doing way too often anyway. Hope this helps, let me know and I'll close out the issue. |
Beta Was this translation helpful? Give feedback.
Hi @Dantyk ,
following https://stackoverflow.com/questions/654310/cleanup-php-session-files, it looks like this session behaviour can/should be fine-tuned in a
php.ini
file.If I were to do it on my server, I would
session-config.ini
file/usr/local/etc/php/conf.d/session-config.ini
I'm not familiar enough with PHP to give advice on which session settings make sense, but the Baikal maintainers/community at https://github.com/sabre-io/Baikal might be able to help.
That all said, if you want to stick with deleting the files (which may cause issues if you delete fil…