I also ran into this issue. I spent a lot of time configuring UFW, DNS, and other things, but nothing worked. In the end, lowering the MTU to 1400 solved the problem. Honestly, I don’t even understand why this worked...
Just try to set DOCKER_OPTS="--mtu 1400"
in /etc/default/docker
.
Or update docker-compose.yml
like this:
version: '3.8'
services:
php:
image: php:8.3-fpm
container_name: php_app
volumes:
- .:/var/www/html
ports:
- "9000:9000"
networks:
- my_network
networks:
my_network:
driver: bridge
driver_opts:
com.docker.network.driver.mtu: 1400