Coder Social home page Coder Social logo

laravel-docker-dev's People

Contributors

lordkerwin avatar sam-r avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

laravel-docker-dev's Issues

About MailHog service

Hi Sam:

We were talking about how to configure the "docker-compose.yml" and the Laravel ".env" file on the chat of the Erika Heidi dockercon session (about "How to Create PHP Development Environments with Docker Compose") ... Maybe you remember our conversastion.

So, I download your repo and try it and the sending emails process works fine. No like mine.
The configuration of my "docker-compose.yml" and ".env" is similar to yours, but, when I launch the process to send and email, I have this message error on the browser:

Connection could not be established with host 127.0.0.1 :stream_socket_client(): unable to connect to 127.0.0.1:1025 (Connection refused)

Do you know what is the reason of this error?
I had the MAIL_HOST=127.0.0.1 but, after heard your advice, I changed it to the name of my Mailhog service name.
But even with that, I also don't fix the error, even if I follow your suggestions and put the same MAIL environment variables on the ".env" file. The error I receive is the same.

On the other hand, I realize that you name the MailHog service like "mailhog", the same reference for MAIL_HOST, and another inside the Dockerfile:

[docker-compose.yml]

    mailhog:
        image: mailhog/mailhog

[Dockerfile.app]

RUN echo '\n\
host mailhog\n\
port 1025\n\
from [email protected]\n' \
>> /etc/msmtprc

[.env]
MAIL_HOST=mailhog

But, if the name of the services in the "docker-compose.yml" is a random personal choice, that is, that it is possible to put the name that you want to each service, then, if I replace "mailhog" with "mailhog_server" in the 3 references mentioned above, why the email sending process fails showing this error message?:

Connection could not be established with host mailhog :stream_socket_client(): php_network_getaddresses: getaddrinfo failed: Name or service not known

...even if rebuild the "php" service image with this command when I up the services:

docker-compose up -d --build

Where can a reference to the previous term persist (which, supposedly, would no longer have to exist after the change mentioned in each of the 3 files), even after a reconstruction of the "php" service?

So, only it can works if the reference is "mailhog"? and it is impossible that works if it is apply another name? Why?

And, another more question ... Is it necessary to put the Mailhog lines on the Dockerfile so that there can be a communication between the PHP application and the MailHog server and therefore the emails are sent? If you don't put this lines on the Dockerfile, the email sending process doesn't work?
Where did you get the idea of putting that MailHog reference into the Dockerfile? I have not seen anything like it in the MailHog documentation and much less, they say it is necessary.

I would appreciate receiving a response from you ... Best regards.

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.