• 5 Posts
  • 24 Comments
Joined 2 years ago
cake
Cake day: June 14th, 2023

help-circle










  • 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.