Rank 2: Process
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?
Votes
0
Replies
24
Participants
Unknown
Messages
25
Rank 2: Process
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?
Admin
you shouldnt use https if your dart server doiesnt have https
Admin
oh thats right...host.docker.internal might be a docker desktop thing
Rank 2: Process
It doesn't, yeah. I was getting a bit despaired for a solution so I tried everything that went through my mind lol
Rank 2: Process
Yeah, apparently it seems to be a windows thing as well, but I could be wrong
Admin
how are you running your dart server? docker compose?
Rank 2: Process
Just executing the dart frog serve for now, was gonna containerize it after I was done testing
Admin
oh...you cant do docker networking if its not in a container 😜
Rank 2: Process
Really? Lol, so have been trying all this time the wrong way xD
Rank 2: Process
Wait, so you can't make docker connect to the localhost?
Rank 2: Process
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
Rank 2: Process
That's how it works?
Admin
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.
Admin
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
Rank 2: Process
Thank you, glad to learn something new
Rank 2: Process
Yeah, I wanted to avoid that
Rank 2: Process
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
Rank 2: Process
Rather the webhook worker
Admin
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
Rank 2: Process
Oh ok, got you
Rank 2: Process
I'll try that then. Thank you so much for your help
Rank 2: Process
Finally was able to make them communicate, thank you 
Rank 2: Process
For anyone finding this, I did the following steps:
A few things to note:
If you have questions or found an easier solution, I'm all ears:)
Admin
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
Rank 2: Process
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