This is really not possible. Unless you define volumes
in docker-compose, the container can not write anything into the host's filesystem.
Prove that with
> docker inspect apache2-php-container | jq .[].Mounts
> docker inspect apache2-php-container | jq .[].Volumes
You also can reverse-prove that by creating a file in your ominous Host's log folder and try finding it within the container (you didn't mention where this folder is or should be located within your container. Note: Even if a container would write files onto the Host, it would also be accessible from within the container at some path, of course - because it needs to be mounted somewhere)
I even reproduced your hierarchy and verified there are no folders created.
samples > docker-compose build
Building apache2-php
Sending build context to Docker daemon 3.584kB
...
Successfully tagged apache2-php-image:latest
samples > docker-compose up -d
Creating network "samples_default" with the default driver
Creating apache2-php-container ... done
> tree
.
└── samples
├── docker
│ └── apache2
│ ├── Dockerfile
│ └── sites-available
│ └── mysite.conf
└── docker-compose.yaml
4 directories, 3 files
The logging even goes to the docker logs output:
> curl -I http://localhost:8082/bla
HTTP/1.1 404 Not Found
Server: Apache/2.4.10 (Debian)
apache2-php-container | 172.21.0.1 - - [17/Nov/2021:12:34:16 +0000] "HEAD /bla HTTP/1.1" 404 140 "-" "curl/7.69.1"
You may have some kind of cache hitting there.
Try to clean your system (docker system prune -a -f
(careful!)) or test it on another untouched system.
tip: docker-compose build --no-cache