0

我对此有点困惑,所以我希望你在我的 docker-compose 中提供帮助,我想我已经配置了所有想要的东西。但问题是,当我尝试通过 symfony 在 Mercure 中发布某些东西时,他不想这样做,但是当我尝试不通过 symfony(使用 js)传递时,它会起作用如果有人有想法,那会很酷

version: '3.8'
services:
  web:
    build: 
      context: .
      target: Symfony_PHP
    container_name: web_symfony
    ports:
      - 90:90
      - 943:943
    restart: always
    volumes:
      - ./portailcse/:/var/www/app/
      - symfony-cache:/var/www/app/var/cache
      - symfony-log:/var/www/app/var/log
      - symfony-vendor:/var/www/app/vendor
    networks:
      - dev
    depends_on:
      - db
  mercure:
    image: dunglas/mercure
    container_name: mercure
    restart: unless-stopped
    environment:
      # Uncomment the following line to disable HTTPS
      SERVER_NAME: ':90'
      MERCURE_PUBLISHER_JWT_KEY: 'testjwt'
      MERCURE_SUBSCRIBER_JWT_KEY: 'testjwt'
      # PUBLISH_ALLOWED_ORIGINS: '*'
      # CORS_ALLOWED_ORIGINS: '*'
      # ALLOW_ANONYMOUS: 1
      # DEBUG: 'debug'
      # Uncomment the following line to enable the development mode
    command: /usr/bin/caddy run -config /etc/caddy/Caddyfile.dev
    ports:
      - 7001:90
    volumes:
      - caddy_data:/data
      - caddy_config:/config
    networks:
      - dev
  
networks:
  dev:
volumes:
  symfony-vendor:
  symfony-log:
  symfony-cache:
  caddy_data:
  caddy_config:

在此处输入图像描述

###> symfony/mercure-bundle ###
# See https://symfony.com/doc/current/mercure.html#configuration
# The URL of the Mercure hub, used by the app to publish updates (can be a local URL)
MERCURE_URL=http://mercure:7001/.well-known/mercure
# The public URL of the Mercure hub, used by the browser to connect
MERCURE_PUBLIC_URL=http://mercure:7001/.well-known/mercure
# The secret used to sign the JWTs
MERCURE_JWT_TOKEN=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJtZXJjdXJlIjp7InB1Ymxpc2giOlsiKiJdLCJzdWJzY3JpYmUiOlsiKiJdLCJwYXlsb2FkIjp7InJlbW90ZUFkZHIiOiIxMjcuMC4wLjEifX19.y6WSZvqaNkya67gRr2ta9R4fnPAv9-7EmPhQvfz6GJA
###< symfony/mercure-bundle ###

谢谢大家

在此处输入图像描述

4

0 回答 0