The purpose of these files is to keep the container's execution logs and will be useful to preserving memory and preserve the log history if the server is restarted.
You can clean these files, but there will be consequences:
One is the loss of the history record of the container associated with the clean file. Another is a docker log writer error if the file is open at cleanup time, depending on the method used for cleanup.
There are many answers associated with the question: "how to clear docker logs?"
So I'm going to summarize and point to them.
You can try the truncate command to clean the file:
sudo sh -c "truncate -s 0 /var/lib/docker/containers/*/*-json.log"
Another way is to delete and recreate your containers, this will reset your logs.
However, the best way, in my opinion, is to rotate the logs through the docker. As described in the official documentation about logging.
docker run --log-opt max-size=10m --log-opt max-file=5 my-image:<version>
Credits and related answers:
Official docker documentation for logging in compose file:
https://docs.docker.com/compose/compose-file/compose-file-v3/#logging