I’m trying to use a different .env file called: .env.production.local in my docker compose.
However, when I use the --env-file
parameter in the docker compose
command. I get the following warning/error logs:
The Compose file './docker-compose.yml' is invalid because:
services.api.ports contains an invalid type, it should be a number, or an object
services.frontend.ports contains an invalid type, it should be a number, or an object
According to the docs this should work, and it looks like it does because all my containers run without a problem. But I don’t understand why I’m getting this error.
This is my command: docker compose -f docker-compose.yml --project-name app-project --env-file .env.production.local up -d --build
I’ve also tried it with the old docker-compose
command. But I’m getting the same result.
This error disappears when I use the default .env
file. But since I’ll have multiple environments I don’t want to go this route.
Does anyone have experience with this issue?