I am new docker. I am facing issue in Docker compose. please help me for that.
below is the my docker-compose.yaml file
version: "2"
services:
database:
image: mysql:5.7
volumes:
- ./data:/var/lib/mysql
environment:
MYSQL_ROOT_PASSWORD: somewordpress
MYSQL_DATABASE: wordpress
MYSQL_USER: wordpress
MYSQL_PASSWORD: wordpress
wordpress:
image: wordpress
depends_on:
- database
ports:
- "8080:80"
restart: always
environment:
WORDPRESS_DB_HOST: database:3306
WORDPRESS_DB_USER: wordpress
WORDPRESS_DB_PASSWORD: wordpress
WORDPRESS_DB_NAME: wordpress
volumes:
db_data: {}
Below is the error i am getting. please help me to fix the error.
ERROR: The Compose file './docker-compose.yaml' is invalid because:
services.wordpress.volumes contains an invalid type, it should be an array