R
R
Romi2022-02-13 16:32:23
Docker
Romi, 2022-02-13 16:32:23

Laradock: why do I change the version of php-fpm (docker-compose build php-fpm) in one project folder and change the version in another folder?

I have some kind of tinny going on today :)

I decided to try the new PHP, I specially made a folder for it with the new Laradock (inside the new folder of the new project), and I had to run it there docker-compose build php-fpmbecause otherwise it was PHP 7.4. despite the fact that .env had 8.0

So now I have php-fpm version 8.0 in all my projects :(

How did this happen?

After all, if Laradock is in a separate folder, it should be separate from other laradocks?

/proj1/Laradock/

/ proj2/Laradock/

and they turn out to be dependent on each other? how is it?

I also make different config paths for them:

DATA_PATH_HOST=~/.laradock/proj1

DATA_PATH_HOST=~/.laradock/proj2

how can they be divided at all??

I want to be able to run different versions of PHP in different projects - how can I do that?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
Romi, 2022-02-13
@romicohen

In short, I had to read the doc)) they recommend changing the value:
COMPOSE_PROJECT_NAME
now .env
I’m trying it, if it works out
, I’ll unsubscribe PS In general, yes, this is the solution. If you don't set the variable COMPOSE_PROJECT_NAMEto be unique for each instance of Laradock, then it "intersects" with each other, and you get all sorts of rubbish :D On the other hand, in this case it takes up less space. But if you need different Laradock configurations with different PHP versions, then COMPOSE_PROJECT_NAMEyou need to make this unique for a project that differs from the general mass (in my case, this is PHP 8.0, and I even managed to upgrade from PHP 8.1).

A
Alexander Karabanov, 2022-02-13
@karabanov

Run:

docker ps --filter "label=com.docker.compose.project" -q | xargs docker inspect --format='{{index .Config.Labels "com.docker.compose.project"}}'| sort | uniq

It will probably display just one name of the Laradock project.
The problem is that the project is named after the directory from which it was launched. Name the directory not Laradock , but, for example, Laradock_project_name

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question