无法配置新的Dunglas/水银图像 [英] Can not configure the new dunglas/mercure image

查看:57
本文介绍了无法配置新的Dunglas/水银图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问题:

Dunglas Mercure本周刚刚升级,并且已完成更改,它现在使用Caddy WebServur解决方案而不是内置的WebServur,这看起来非常酷,但是现在,我无法配置Dungal/Mercur图像了...

Dunglas Mercure just upgraded this week, and has completly change, it now use a caddy web serveur solution instead of a built-in web serveur, it seems to be very cool, but now, i can not configure my dunglas/mercure image anymore...

https://mercure.rocks/docs/UPGRADE

所以问题似乎与此次更新直接相关,因为现在,dunglas/mercure图像是从caddy网络服务器图像中构建的,而在此之前我可以像这样配置我的图像:

So the problem seems to be directly related to this update, because now, the dunglas/mercure image is built from a caddy web serveur image, and where before i could just configure my image like this:

mercure:
    image: dunglas/mercure
    environment:
      - JWT_KEY=MySecret
      - ALLOW_ANONYMOUS=1
      - PUBLISH_ALLOWED_ORIGINS=http://localhost
      - DEBUG=1
      - CORS_ALLOWED_ORIGINS=http://localhost:8080
    ports:
      - 3000:80

现在它不再起作用(Caddy使用他的默认caddyFile,该文件在dunglas/mercure图像调用的caddy网络服务图像中设置)

Now it don't work anymore (Caddy is using his default caddyFile, which is set in the caddy web serveur image called by the dunglas/mercure image)

我无法通过Mercure/Dunglass图像(配置jwt_key,cors等...)来配置caddy Web Servur.

I did not succeed to configure caddy web serveur through mercure/dunglass image (configure jwt_key, cors etc...)

所以我首先想知道是否有一种方法可以配置此新映像?

So i'm first wondering if there a way to configure this new image?

然后,如果无法对其进行配置,那么我想知道如果无法配置此新的USELESS mercure图像,它的目的是什么,并且必须使用正确的预配置来制作自己的图像球童网络服务器?

And then, if there's no way to configure it, i'll would like to know what is the purpose of this new USELESS mercure image if we can not configure it, and have to make our own with a correctly pre-configured caddy web server?

推荐答案

所以,我为自己的无知表示歉意,尽管我仍然对docker和docker compose感到陌生,但此更新使我感到恐慌.

So, i have to apologize for my ignorance, while i'm still a noob on docker and docker compose, this update put me in panic.

最后,我只是试图将Caddyfile绑定在dunglass/mercure容器中,替换默认的文件conf,就可以了!

Finally, i simply tried to bind a Caddyfile in the dunglass/mercure container, replacing the default file conf, and it worked!

因此在我的docker-compose文件中,Mercure服务现在为:

So in my docker-compose file, mercure service is now:

mercure:
    image: dunglas/mercure
    volumes:
      - ./back/docker/Caddyfile:/etc/caddy/Caddyfile
    ports:
      - 3000:80

还有我的Caddyfile:

And my Caddyfile:

# Learn how to configure the Mercure.rocks Hub on https://mercure.rocks/docs/hub/config
{
    # Debug mode (disable it in production!)
    debug
    # HTTP/3 support
    experimental_http3
}

:80

log

route {
    redir / /.well-known/mercure/ui/
    encode gzip

    mercure {
        # Enable the demo endpoint (disable it in production!)        
        demo
        # Publisher JWT key
        publisher_jwt MySecret
        # Subscriber JWT key
        subscriber_jwt MySecret
        # CORS
        cors_origins http://localhost:8080
        # Allow anonymous subscribers (double-check that it's what you want)
        anonymous
        # Enable the subscription API (double-check that it's what you want)
        subscriptions
    }

    respond "Not Found" 404
}

如果可以帮助某人!

这篇关于无法配置新的Dunglas/水银图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆