• 36 Posts
  • 33 Comments
Joined 3 years ago
cake
Cake day: June 14th, 2023

help-circle










  • Research what different routes there are to take. Pick one you like. Try to set it up without depending on it just yet. Learn from your mistakes, and what drawbacks you find. Reevaluate your choices and pick another (mabye even on different storage, and do it all again. I bet most selfhosters go trough a few different setups till landing on a favorite. For me, its cosmos-server at home, and a fairly vanilla containeraized treafik setup for my vps.





























  • Ok, I updated my drawing, so the arrows are correct:

    ┌─────────────────────────────────────────────────────────────────┐
    │ Browser                                                         │
    └─────────────────────────────────────────────────────────────────┘
                                    ▲                                  
                                    │ :443                             
                                    │ :80                              
                                    ▼                                  
    ┌────────────────────────────────────────────────────────────────┐ 
    │ Proxy (traefik)                                                │ 
    └────────────────────────────────────────────────────────────────┘ 
         ▲                               ▲                  ▲          
         │                               │                  │          
         │ :3000                         │ :8085            │  :5001   
         │                               │                  │          
         ▼                               ▼                  ▼          
    ┌───────────────────────┐   ┌────────────────┐  ┌────────────────┐ 
    │ DBgate (in docker)    │   │ pgBackupWeb    │  │ My custom app  │ 
    └───────────────────────┘   └────────────────┘  └────────────────┘ 
         ▲                               ▲               ▲             
         │ :5432                         │ :5432         │ :5432       
         │                               │               │             
         ▼                               ▼               ▼             
    ┌────────────────────────────────────────────────────────────────┐ 
    │ Database                                                       │ 
    └────────────────────────────────────────────────────────────────┘ 
    

    DbGate is connecting to my postgresql db. If I kill the container the communication is cut off. The ports 3000, 8089, 5001, 5432 are not open. How does DbGate load my postgres data then, if no backend? Sometimes I use it when my client messes up something thats only repairable in the db. Thats the exact scenario where its useful to run it in docker.

    It’s right in their docs

    Where? The app runs in the browser, but the data is still remote (from the pov of the browser)


  • It seems there is a misunderstanding. To be clear, this is what I mean:

    ┌───────────────────────┐    
    │ Browser               │    
    └───────────────────────┘    
         ▲                       
         │ port 443 open         
         │                       
         │                       
    ┌────┼──────────────────┐    
    │ Proxy (traefik)       │    
    └───────────────────────┘    
         ▲                       
         │                       
         │ web port open to proxy
         │                       
         │                       
    ┌────┼──────────────────┐    
    │ DBgate (in docker)    │    
    └───────────────────────┘    
         ▲                       
         │                       
         │                       
         │                       
    ┌────┼──────────────────┐    
    │ Database              │    
    └───────────────────────┘    
    

    This way DBgate serves the web app to the browser, but also acts as a ‘backend’ which connects to the database. This way my databases are not exposed to the web, only the proxy is, which handles domain name routing and http traffic.