I am working on a php docker application.Am facing an error while trying docker-compose up command

Viewed 38

my docker-compose.yml file

version: "3.9"
services:
    web:
    build: .
    ports:
        - "5000:5000"
redis:
   image: "redis:alpine"

my err :

ERROR: In file './docker-compose.yml', service 'build' must be a mapping not a string.
1 Answers
  • Make sure you are not using TABs, but just SPACEs ( YAML does not support TABS)

  • Also, You have wrong indentation in your YAML file:

it should be:

version: "3.9"
services:
  web:
    build: .
    ports:
     - "5000:5000"
  redis:
    image: "redis:alpine"
Related