Closed dorkster100 closed 9 months ago
Hi @dorkster100 I think I know the problem. The usage of compose is intentional. is defined to be mapped in the configuration. I don't use docker-compose because it was deprecated and from the docs is expected to use docker compose
.
What I think it happen is that the wrong environment was being loaded. Could you check the :checkhealth laravel
that should show which environment was being use ?
I notice that lua does not respect the index for alphanumeric keys so I have to do a little refactor so the order in the config is respected.
the fix is live
laravel: require("laravel.health").check()
Laravel ~
- OK fd installed
- OK rg installed
Environment ~
- OK Environment setup successful
- Name: local
- Condition:
- {
executable = { "php" }
}
- Commands:
- {}
Composer Dependencies ~
- OK Composer dependency `doctrine/dbal` is installed
- OK Composer dependency `laravel/tinker` is installed
@adalessa after update it got better, it recognized the DockerCompose env, but now the commands dont work Error executing lua callback [NULL]
, and again it fixed setting docker-compose
for me, i think he does not recognize it as executible otherwise.
does your version of docker have the sub command compose docker compose
?
From the documentation the way to run docker compose is like that https://docs.docker.com/compose/gettingstarted/#step-4-build-and-run-your-app-with-compose. The settings yes it's for case like that change the compose command as you may need and the container exec.
yes my version works with docker compose
and all docker environvent commands work like DockerCompose ps
here is health now:
laravel: require("laravel.health").check()
Laravel ~
- OK fd installed
- OK rg installed
Environment ~
- OK Environment setup successful
- Name: docker-compose
- Condition:
- {
executable = { "docker" },
file_exists = { "docker-compose.yml" }
}
- Commands:
- { {
commands = { "php", "composer", "npm" },
docker = {
container = {
default = "app",
env = "APP_SERVICE"
},
exec = { "docker", "compose", "exec", "-it" }
}
},
compose = { "docker", "compose" }
}
what command gives you the error ?
Laravel routes
and Laravel artisan
, just to be clear first health that i posted was with previous commit, sorry to confuse.
Yes I realize that. To confirm the problem if in the config you change to
{
name = "docker-compose",
condition = {
file_exists = { "docker-compose.yml" },
executable = { "docker" },
},
commands = {
compose = { "docker-compose" },
{
commands = { "php", "composer", "npm" },
docker = {
container = {
env = "APP_SERVICE",
default = "app",
},
exec = { "docker-compose", "exec", "-it" },
},
},
},
}
With this should be using only docker-compose
Laravel artisan
now works, Laravel routes
still fail with same error
I will have to create an environment to test, I tested with sail and local with no issue. I will appreciate if you have some examples of your docker configuration that you could share.
Is there some sort of cache? Because now artisan works with no changes, but routes does not
The caches are clean on setup, you can run :Larave cache:clean
to trigger it. Routes could be if the state of the aplication could not retrieve the routes. Something wrong on the web.php for example.
Yes, you were right I actually had some errors with composer. Would be nice to have some error output. okay, now it seems to work.
Agree, I will check on that.
I have pushed a version that should report the error from the artisan commands. I think with that we can close the ticket for now.
The problem is that compose executable does not exist for me, is there a reason it is not
docker-compose
? Replacing compose with docker-compose in this file fixes this issue for me.On another note,
create_user_command
for some reason does registerDockerCompose
every other time even with non existing executablecompose
, so there is also some issue with that.