Update composer Troubles when developing Laravel in Docker

mobin shaterian
2 min readSep 14, 2020

develop Laravel on docker some times make many troubles. in this article reviews the troubles of Laravel when want composer update.

my Architecture to build Laravel has many steps. at first, develop code on my computer and then send it to the develop server then build docker in the develop server and at last sending docker rep into the deploy server.

in this Architecture using composer to install some packages make many troubles and spend lot’s of time to debug some issues.

when composer update using these cache clear

php artisan cache:clear

permition of /bootstrap/cache/

php artisan config:clear

php artisan route:clear

important thing is when build docker in development server must using clear cache.

SQLSTATE[HY000] [2002] No such file or directory (SQL: select * from information_schema.tables and table_name = migrations)

this problem not appear as please clear your cache!. at first laravel say that can’t not connect to database in deploy server but after exec docker container with command below:

docker-compose exec docker-name bash

you understand that cache exist in deploy server and you force that fix this problem in develop server .

--

--