When I try to connect php whith the container that has the mysql server I get this error This is the docker compose file: This is the connection class: Now that I changed the host to 127.0.0.1, the connection is refused. And there’s no way that the MySQL server isn’t running, cause i can connect t…
Tag: docker-compose
How to solve Laravel cant connect with mysql through docker
Im trying to deploy my laravel app using docker. Then I created docker-compose.yml file and Dockerfile like below. docker-compose.yml Dockerfile And when I try docker-compose up, all the containers run with a any error. And also when I run docker-compose ps, it shows like this, But, when laravel application, …
How to enable php extensions when using the image php:7.2-apache with docker-compose?
I want to run a apache webserver with php extension inside container using docker compose as deployment. My compose file looks like this: how can I enable the following extensions. Answer First of all you can run php -m in php container to see installed and enabled modules. You can edit your docker-compose.ym…
From which Dockerfile should composer install be called from
I need to call composer install and unsure from which Dockerfile to call it from – Dockerfile-apache or Dockerfile-php-fpm? Should I install composer in Dockerfile-apache (and PHP CLI?) and run it from there? Running composer install from Dockerfile-php-fpm gives me this: Composer could not find a compo…
Bad hostname provided
Passport Version: ^10.1 Laravel Version: 8.77.1 PHP Version: 8.0.9 Database Driver & Version: mysql 8.0.27 I can not get access token. when I call it manual by curl it get this response. this host name is generate inside the docker container I’m test 192.168.224.6 ip of docker container but it also …
Why nginx ignores root and location directives?
I’m running Nginx as a service in docker-compose, with a volume mounted at /app inside the container. I just copied the whole project structure from Linux to MacOS where it worked fine. Here is my docker-compose.yml: I have a simple configuration for a PHP app, but the root directive inside location see…
Docker Cannot assign requested address
I think I’m pretty close (I hope) to having xdebug running in a docker container, aiming to connect via Visual Studio Code. I think that maybe I’m supposed to add a config to the /etc/hosts file in the container, directing an IP address to the url my files are being served over, but am not sure wh…
docker entrypoint sh file restarting
I am testing docker with my php project. Everything is ok in testing but if I add ENTRYPOINT, docker is restarting. Here is my docker compose file Dockerfile start-container.sh file I also print log for that docker image. I think my error is docker container is restarting after running start-container.sh file…
Symfony 5 Fast Track: Database access error
I’m trying to go through the aforementioned tutorial, but I get stuck on the stage between Step 7 and 9 – when the database goes into action. On local server I get and while on my deployment server everything seems to work good when reading the database: https://akodg6sfgq-gijxpyj6oxpig.eu.s5y.io/…
nginx return file not found with nginx-proxy and doesn’t load static files
I’m using nginx-proxy-automation to run my php application which is written using CodeIgniter 4 and the app structure is the following: the index.php file is available inside the public folder. The docker-compose.yml of php-application contains the following stuff: Inside the php-application/docker-comp…