Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in DevOps and Agile by (29.3k points)

I'm getting issue when running docker-compose.yml file and below is the script written in the file 

version: '3.3'
services:
 db:
 image: mysql:5.7
 volumes:
 - db_data:/var/lib/mysql
 restart: always
 environment:
 MYSQL_ROOT_PASSWORD: somewordpress
 MYSQL_DATABASE: wordpress
 MYSQL_USER: wordpress
 MYSQL_PASSWORD: wordpress
 wordpress:
 depends_on:
 - db
 image: wordpress:latest
 ports:
 - "8000:80"
 restart: always
 environment:
 WORDPRESS_DB_HOST: db:3306
 WORDPRESS_DB_USER: wordpress
 WORDPRESS_DB_PASSWORD: wordpress
volumes:
 db_data: 

Below is my error:

ERROR: In file './docker-compose.yml', service 'image' must be a mapping not a string.

Please help.

1 Answer

0 votes
by (50.2k points)
edited by

Check the spacing issues and using the same we are able to deploy WordPress:

For reference check this github link:

Try the above steps and hope it works. For more information refer to this DevOps Tutorial.

31k questions

32.4k answers

501 comments

693 users

Browse Categories

...