I've this compose file but when I try to execute it an error is thrown:
ERROR: The Compose file '.\docker-compose.yml' is invalid because: services.db.environment contains an invalid type, it should be an object, or an array.
version: '3.1'
services:
my-apache2:
build:
context: .
dockerfile: Dockerfile
ports:
- 80:80
volumes:
- ./src:/var/www/html/
db:
image: mysql
command: --default-authentication-plugin=mysql_native_password
restart: always
environment:
MYSQL_ROOT_PASSWORD:oh686bf
adminer:
image: adminer
restart: always
ports:
- 8080:8080
The above yaml file is for entering data from a HTML file to the MySQL server.
Can anybody tell me what is wrong in environment in this yml file?