Back

One droplet or two, due to ports?

  • 0
  • Self Hosted
  • Web
Maktech07
1 Jul, 2023, 06:21

My current architecture is appWrite, a sveltekit website and a python websocket server. I was trying to deploy the sveltekit and python websocket server as docker containers on the same machine as appWrite. But appWrite needs to be on 80/443 and I think my website needs to be on 80/443 so, does that mean I need a second droplet for my sveltekit website?

Right now the sveltekit website is running as a container on the same droplet but on port 3000.

Learning my way around all of this so any suggestions would be helpful.

TL;DR
The issue was with ports and networking in Docker containers. The user was able to solve the problem. There was a discussion about inspecting networks and docker-compose overrides. The user mentioned that AppWrite might be causing the issue. The user asked about using Traefik and Nginx in the same network. There was an error related to AppWrite and Traefik not being resolved. There was a question about the forwarding port for AppWrite. There was a discussion about managing hostnames with DigitalOcean. There was a suggestion to use a reverse proxy like Nginx Proxy Manager. The user mentioned that the website and AppWrite are
Maktech07
1 Jul, 2023, 06:24

so now when I go to my site, I see appWire's login and go to site:3000 I see the website.

Drake
1 Jul, 2023, 13:58

In general, you can have multiple services on the same machine and on the same port if they're accessed using a different hostname. You do this by running your services on a non standard port and putting a reverse proxy in front running on 80/443. The reverse proxy receives the request, checks the hostname in the request, and then directs the request to the appropriate service.

I use Nginx Proxy Manager (NPM) because it's a simple GUI interface for Nginx. If you want to try this out, check out https://medium.com/@stnguyen90/how-to-run-appwrite-behind-nginx-19348ed34243

Maktech07
1 Jul, 2023, 15:19

in managing those host names does DigitalOcean have an equivalent service like AWS's Route53?

Maktech07
1 Jul, 2023, 15:22

I'll take a look appreciate the help

Drake
1 Jul, 2023, 15:29

I don't think so, but I'm not sure

Maktech07
3 Jul, 2023, 21:35

@Steven I was going through you article above and in the section for "Adding AppWrite to NPM" you say to set the forwarding port to 443. But AppWrite is setup with a different https port (8443 for example). The forwarding port is the internal port I thought? I have a sveltekit app on port 3000 in another docker container and it's forwarding port is 3000.

Drake
3 Jul, 2023, 21:54

You would use 443 because the routing is within the docker network rather than from external

Maktech07
4 Jul, 2023, 05:23

so running into this error in the logs "appwrite-traefik could not be resolved (2: Server failure)"

Maktech07
4 Jul, 2023, 05:23

it is the name of the container

Drake
4 Jul, 2023, 05:31

Did you put traefik and nginx in the same network?

Maktech07
4 Jul, 2023, 05:42

Here is my proxy manager docker compose:

Maktech07
4 Jul, 2023, 05:43

here is my docker-compose-override for appWrite

Maktech07
4 Jul, 2023, 05:43

here are the networks I see: NETWORK ID NAME DRIVER SCOPE 38ef7bb4acd7 appwrite_gateway bridge local c222c8f99200 bridge bridge local 25ba68b4dc19 host host local 10247f8df87e none null local b6ea3209e71f npmdockernet bridge local

Maktech07
4 Jul, 2023, 05:44

so appwrite is getting its own, so that might be the issue

Maktech07
4 Jul, 2023, 05:56

going to try your docker-compose and overrides from your article verbatim and see

Drake
4 Jul, 2023, 15:38

Do docker inspect npmdockernet

Maktech07
5 Jul, 2023, 16:14

I figured it out. appreciate the suggestions

Drake
5 Jul, 2023, 16:44

what was the problem?

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more