devilbox
devilbox copied to clipboard
[Howto]: Communicate between 2 projects from php container
Have you already checked elsewhere?
- [X] I have read the Devilbox documentation
- [X] I have checked the Devilbox Troubleshooting Guide
- [X] I have checked the Devilbox FAQ
- [X] I have checked the Devilbox Howto
- [X] I have checked the Devilbox Forum
- [X] I have checked existing issues
- [X] I have googled already with no luck
- [ ] I have not done any of the above
What are you struggling with?
Hello,
My problem is related to the connection of 2 projects that must communicate with each other.
2 projects are reachable from host, but not from container
What is your goal?
I would like to make 2 projects communicate with each other,
So I have my project folder which contains my project A & B.
My project A needs to call the api of project B to get information.
I use the guzzle client in project A so I call the api with the following url as I would in postman for example "b.loc/api/endpoint" this works fine on the postman side, but how do I do it in the container?
Currently, it returns me the "localhost" dashboard page of devilbox
This should work by default. Is bind
running? Also, can you do a curl at both of your API's from within the PHP container.
This should work by default. Is
bind
running? Also, can you do a curl at both of your API's from within the PHP container.
Hey thanks for reponse,
The bind
container running fine.
Calling my API from PHP ⇒ return devilbox dashboard Calling my API from PHP container with curl ⇒ working, get expected response
Calling my API from PHP ⇒ return devilbox dashboard
Can you share the code snippet that is calling the API
@TheoD02 This works perfectly fine from inside the container. I assume that this has been resolved as the requested information has not been provided.