Docker compose up issue

docker-compose.yml
version: “3”
services:
redis:
image: redis
application: zavertis/ocr-docker-build:tag zvaertis 60bdebacda9a8a05cbf971a427ec430bd0a588d60cfcd7ffda3c264efd6d287d
image: dockerfacile/app
ports:
- 5000:5000

Hi everybody,

with the code above of my docker-compose file. I’ve downloaded an image dockerfacile/app
But when I try to launch the command docker-compose up the error below occurs :

yaml: line 2: mapping values are not allowed in this context

I’ve scrolled some solutions but they didn’t solve my problem.
If some have an idea, I thank him a so much.

Regards,

Please format your post according this link: How to format your forum posts

Hi everybody,

with the code below of my docker-compose file. I’ve downloaded an image dockerfacile/app
But when I try to launch the command docker-compose up the error below occurs :

yaml: line 2: mapping values are not allowed in this context

I’ve scrolled some solutions but they didn’t solve my problem.
If some have an idea, I thank him a so much.


docker-compose.yml
version: “3”
services:
redis:
image: redis
application: zavertis/ocr-docker-build:tag zvaertis 60bdebacda9a8a05cbf971a427ec430bd0a588d60cfcd7ffda3c264efd6d287d
image: dockerfacile/app
ports:
- 5000:5000

Regards,

I am pretty sure you can see that the code you shared is not what you are actually using. You have a yaml syntax error, but if you can’t share the exact code you use, we can’t tell you for sure what the error is.

When you format your code, don’t just copy the already broken code, but share the original. @meyay suggested to edit your original post because even if we fix it for you, we can’t tell if that was the code you have used or just copied incorrectly.

As we usually say: Help us to help you.

By the way there is no “application” key ina compose file so I have no idea what that is in your file.

PS.: I removed your second topic called “Docker compose issue2”. Please, don’t create new topics for the same issue an if you create a topic, choose a proper name that describes it.

Thank you for your contribution.
I don’t know exactly what original code you mean but I think I’ve done an error in the username (on line application) the let’s me put below the one that I’m using.


docker-compose.yml
    version: "3"
    services: 
      redis: 
        image: redis
      application:  zavertis/ocr-docker-build:tag zavertis 60bdebacda9a8a05cbf971a427ec430bd0a588d60cfcd7ffda3c264efd6d287d
        image: dockerfacile/app
        ports:
          - 5000:5000

Even when I change the image name dockerfacile/app by build . it does’nt work.

Regards,

I removed the indentation and commented the part that doesn’t make sense:

version: "3"
services: 
  redis: 
    image: redis
  application:
    #zavertis/ocr-docker-build:tag zavertis 60bdebacda9a8a05cbf971a427ec430bd0a588d60cfcd7ffda3c264efd6d287d
    image: dockerfacile/app
    ports:
      - 5000:5000

As a result it would deploy a service called redis, based on the image redis:latest with not configuration, and a service called application, based on the image dockerfacile/app and container port 5000 published to host port 5000.

We can not tell you what the commented out line is supposed to mean.

Well at the beginning, there were nothing in front of application.
But after encountering error when trying to execute docker-compose up, I saw somewhere in the net some suggest me to put the line you have commented.
So It was like this :

docker-compose.yml
    version: "3"
    services: 
      redis: 
        image: redis
      application: 
        image: 
        ports:
          - 5000:5000

Can’t have been like that either, as there is no image used, which makes it still not a valid compose file.

What do you want to achieve? What is the big picture here?

Note: adding the filename into the preformatted text block, and adding extra indentation is to separate the filename from the content, does more harm than good.

Ok; I change it. I’m beginner, I’m learning Docker troughout a tutorial. The purpose of the code below is to create a docker-compose file to manage container that I need to create.

version: "3"
services: 
  redis: 
    image: redis
  application: 
    image: dockerfacile/app
    ports:
      - 5000:5000

It should work with the lastest compose file you shared.

It’s ok know.

Thank so much.