[warning] docker-compose up --build

The result of docker-compose up --build
mysql_1 | 2019-12-24T05:20:54.110090Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
mysql_1 | 2019-12-24T05:20:54.114588Z 0 [ERROR] --initialize specified but the data directory has files in it. Aborting.
mysql_1 | 2019-12-24T05:20:54.114655Z 0 [ERROR] Aborting
mysql_1 |
How to fix this warning this in docker-compose.yml

mysql:
image: mysql:5.7
restart: always
environment:
MYSQL_ROOT_PASSWORD: ‘12345’
MYSQL_DATABASE: ‘online_base’
volumes:
- ./docker_conf/my.cnf:/var/lib/mysql
- /var/lib/mysql/online_base:/var/lib/mysql
ports:
- 3336:3306

I try to correct by i addd this line to my.cnf which is located in my app ./docker_conf/my.cnf```
explicit_defaults_for_timestamp = 1

However It doesn't work