I can't throw mercury (bundle) on Symfony/Docker

26 Views Asked by At

for me my installation of mercury is ok, I use docker to simulate an sql image as well as mercury, I work under symfony on my pc, when I launch mercury, in particular on the page http://localhost:3000 where I should have a welcome message I have an error, "access to the site impossible" here is my config:

env.local:

            MERCURE_PUBLISH_URL=http://localhost:3000/.well-known/mercure
            MERCURE_JWT_KEY=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJtZXJjdXJlIjp7InB1Ymxpc2giOlsiKiJdfX0.aP8SuyD3iv0KzZrkIuptBDK0z35T1g0fUsqqPF_-aII
            MERCURE_PUBLISHER_JWT_SECRET=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJtZXJjdXJlIjp7InB1Ymxpc2giOlsiKiJdfX0.aP8SuyD3iv0KzZrkIuptBDK0z35T1g0fUsqqPF_-aII
            MERCURE_SUBSCRIBER_JWT_KEY=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJtZXJjdXJlIjp7InB1Ymxpc2giOlsiKiJdfX0.aP8SuyD3iv0KzZrkIuptBDK0z35T1g0fUsqqPF_-aII
            MERCURE_ALLOW_ANONYMOUS=1
            MERCURE_CORS_ALLOWED_ORIGINS=http://localhost:81
            MERCURE_PUBLISH_ALLOWED_ORIGINS='http://localhost'

Docker-compose :

            version: '3'
            services:
                php:
                    build: ./docker/php
                    env_file: '.env'
                    volumes:
                    - './:/var/www/mercure-chat:rw'

                nginx:
                    build: ./docker/nginx
                    ports:
                    - 81:80
                    volumes:
                    - './public/:/var/www/mercure-chat/public'

                database:
                    image: mysql:8
                    ports:
                    - 3306:3306
                    volumes:
                    - db-data:/var/lib/mysql
                    environment:
                        MYSQL_ROOT_PASSWORD: secretpass
                        MYSQL_USER: astro
                        MYSQL_PASSWORD: secretpass
                        MYSQL_DATABASE: astrochat

                mercure:
                    image: dunglas/mercure
                    ports:
                    - 3000:80
                    environment:
                        PUBLISH_URL: '${MERCURE_PUBLISH_URL}'
                        JWT_KEY: '${MERCURE_JWT_KEY}'
                        MERCURE_PUBLISHER_JWT_KEY: ${MERCURE_JWT_SECRET:-!ChangeThisMercureHubJWTSecretKey!}
                        MERCURE_SUBSCRIBER_JWT_KEY: ${MERCURE_JWT_SECRET:-!ChangeThisMercureHubJWTSecretKey!}
                        ALLOW_ANONYMOUS: '${MERCURE_ALLOW_ANONYMOUS}'
                        CORS_ALLOWED_ORIGINS: '${MERCURE_CORS_ALLOWED_ORIGINS}'
                        PUBLISH_ALLOWED_ORIGINS: '${MERCURE_PUBLISH_ALLOWED_ORIGINS}'

                caddy:
                    image: caddy
                    volumes:
                        - ./Caddyfile:/etc/caddy/Caddyfile:ro
                    ports:
                        - "80:80"


            volumes:
            db-data:

I have tried to replace http by https or to change the ports but nothing works... can you help me please, thank you

0

There are 0 best solutions below