In docker-compose.yml I'm trying to change the file which contains the environment variables to .env.local file but nothing works. The values are still thoses from .env file. I'm following this doc: https://docs.docker.com/compose/environment-variables/#the-env_file-configuration-option here is my docker-compose.yml file:
version: '3'
services:
mysqldb:
image: mysql:5.7
container_name: project_mysql
volumes:
- mysql:/var/lib/mysql
env_file:
- .env.local
environment:
MYSQL_DATABASE: ${MYSQL_DATABASE}
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
TZ: "Europe/Berlin"
ports:
- "3306:3306/tcp"
I also tried to change the name from the file to .env.local.env, .local.env or .variables.env but nothing new happened. I also clear the caches with
docker kill $(docker ps -q)
docker_clean_ps
docker rmi $(docker images -a -q)
but the problem is still here. And there is no error message or code
I have no idea about what's going wrong. Can anybody help me ?