kool-dev / kool

From local development to the cloud: web apps development with containers made easy.

Home Page:https://kool.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Kool status sem o arquivo docker-compose.yml

zarpelon opened this issue · comments

Kool version:
1.16.0

Cenário:
Tenho uma estrutura com vários containers onde agrrupo pelo contexto, então criei um diretório com vários .yml, exemplo: app1.yml, app2.yml, app3.yml. Acontece que quando estou no diretório app1 e tento executar o kool status parece que ele procura pelo arquivo docker-compose.yml e esse não existe. Seria interessante uma forma de conseguir passar qual é o file que estão mapeados os containers, algo como (esse caso):

kool status -f ../docker/app1.yml

When using a command that is backed on docker compose calls - basically all the commands except for kool docker - we can leverage a Docker Compose feature itself: setting up a COMPOSE_FILE environment variable. You can do that inline like:

COMPOSE_FILE=docker/app.yml kool status

That will make with docker compose underlying commands use the proper desired docker-compose.yml file.

Here is the link for its documentation: https://docs.docker.com/compose/reference/envvars/#compose_file

Notice this feature is really interesting as you can even "merge" compose files like that.


As a side note, in the upcoming kool release 1.19.0 we are going to introduce a new global flag option kool --working_dir docker/other/path ... - which will allow you to run all kool <commands> from a different current working directory than the one your targeted application really is.