Symfony Mercure with Docker compose

I am trying to post private mercury updates, i follow the symfony documentation from near, as indicated I do this :

$update = new Update(
  'https://example.com/books/1',
   json_encode(['status' => 'OutOfStock']),
   true
);

 
$hub->publish($update);

My docker compose file :

 mercure:
  restart: unless-stopped
  image: dunglas/mercure
  environment:
    SERVER_NAME: :1337
    MERCURE_EXTRA_DIRECTIVES: |
      anonymous 0
      cors_origins https://localhost:8080
    MERCURE_SUBSCRIBER_JWT_KEY: '!ChangeThisMercureHubJWTSecretKey!'
    MERCURE_PUBLISHER_JWT_KEY: '!ChangeThisMercureHubJWTSecretKey!'
  ports:
    - 1337:1337
  volumes:
    - mercure_data:/data
    - mercure_config:/config

My project is in HTTPS but not the mercury hub.
At the time of publication I get this error message :

"Couldn't connect to server for "http://mercure/.well-known/mercure"."

I even tried this url :
http://localhost:1337/.well-known/mercure

but nothing changes.

I checked the generated jwt, I found that it is different from the one sent in the cookie, but even by putting a correct jwt manually I still have the same error