Git Product home page Git Product logo

Comments (1)

maxpou avatar maxpou commented on August 24, 2024

Hello @benjaminjonard ,

If you are in the PHP container (docker-compose exec php bash), try to ping the redis container.
Here, is my result:

root@597b06d48146:/var/www/symfony# ping redis
PING redis (172.19.0.3): 56 data bytes
64 bytes from 172.19.0.3: icmp_seq=0 ttl=64 time=0.106 ms
64 bytes from 172.19.0.3: icmp_seq=1 ttl=64 time=0.070 ms
64 bytes from 172.19.0.3: icmp_seq=2 ttl=64 time=0.067 ms
64 bytes from 172.19.0.3: icmp_seq=3 ttl=64 time=0.077 ms
^C--- redis ping statistics ---
4 packets transmitted, 4 packets received, 0% packet loss
round-trip min/avg/max/stddev = 0.067/0.080/0.106/0.000 ms

So, redis host is reachable.
If you are using the SncRedisBundle, you have to fill the configuration file like this:

#config.yml
snc_redis:
    clients:
        default:
            type: predis
            alias: default
            dsn: redis://localhost

In my README.md, I use something like that (in the parameters.yml file):

# path/to/your/symfony-project/app/config/parameters.yml
parameters:
    redis_host: redis

So, you need to adapt the config file like this:

snc_redis:
    clients:
        default:
            # ...
            dsn: redis://%redis_host%

In my humble opinion, it's not a good idea to put the full IP address/dsn in a config file. This is why I was using the parameters.yml.

Kind regards,
Maxence

from docker-symfony.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.