I think this may an issue with oracle cloud itself maybe, I'll try to add the server to the same network as the worker. Would have you instructions for that, please?
you shouldnt use https if your dart server doiesnt have https
oh thats right...host.docker.internal might be a docker desktop thing
It doesn't, yeah. I was getting a bit despaired for a solution so I tried everything that went through my mind lol
Yeah, apparently it seems to be a windows thing as well, but I could be wrong
how are you running your dart server? docker compose?
Just executing the dart frog serve for now, was gonna containerize it after I was done testing
oh...you cant do docker networking if its not in a container π
Really? Lol, so have been trying all this time the wrong way xD
Wait, so you can't make docker connect to the localhost?
I remember having a similar problem long ago with functions, so I had to hit the domain directly instead of localhost.
Oh! So it works in Appwrite because it's a group of containers communicating with one another
That's how it works?
Yes, that's how docker networks work. You create a docker network and put docker containers in there and they can talk to each other via the container name.
And yes, you might be able to use the server hostname to hit your dart server. The downside is your dart server might be publicly accessible then
Thank you, glad to learn something new
Yeah, I wanted to avoid that
So this means if I containerize the dart server, I'll have to make sure it's on the same network as the Appwrite containers
Rather the webhook worker
No it should be in the same docker network as the worker because the worker is what needs to send the request to the dart server
Oh ok, got you
I'll try that then. Thank you so much for your help
Finally was able to make them communicate, thank you <:appwriterocket:823996226894692403>
For anyone finding this, I did the following steps:
- dockerized my app
- create a new docker network
- added the app to this docker network
- used docker ps to find the container id of the Appwrite webhook worker
- add the worker to the created network
- now in web hooks you can use http://[NAME_OF_APP_CONTAINER]:PORT/path and it will hit for you
A few things to note:
- docker has a default network called bridge, so you may be able to use that instead of creating a new network
- I had to explicitly rename my app container because it had an underscore in the middle, and urls (like the one you webhook too) can't have those
- the Appwrite docker compose file has a list of networks but for some reason adding the newly created network there didn't work. As in the worker didn't autoamtically get added to that network
- there may be a way through the bridge to communicate directly with your app, but I didn't explore that possibility
If you have questions or found an easier solution, I'm all ears:)
I suggest using a docker compose file for your dart server so that it's easy to spin up and you can configure the network and whatnot in there.
On the appwrite side, I always suggest using a docker compose override file. With that, you can extend the Appwrite compose file to put the worker in the dart server network
Yes, using docker-compose is definitely a must now
And I didn't know you can override a compose file, this is gonna make things a lot more straightforward, thank you you again
Recommended threads
- Webhook cannot be deleted
After the webhook has been deleted, it can no longer be seen on the page. However, it has been observed that the appwrite-worker-webhook container is still gen...
- Webhook signatures
Hi, can someone help me with webhook signature validation in node js?
- Mistakenly rejected and Closed PR of hac...
Hello i have submitted a project called as Virtual -Labs for hackathon but the PR has been rejected and closed stating i have not used any of the appwrite servi...