I’ve developed a web application based on Plotly’s Dash in Python.
App1: auth, handles user authentication and registration.
App2: quickbio, is an application for processing biological data.
Each app is a standalone Dash application, meaning it has its own configuration:
app = dash.Dash(...)
I’ve been able to communicate between both applications using Nginx as follows:
I deploy app1.
I deploy app2.
I route them using a reverse proxy with Nginx under the same domain, communicating both independent applications.
What I’d like to know is the following: Is it possible to do this natively on Railway?
I’ve seen that you can deploy independent applications from GitHub. By going to “New Project” and adding each repository there, So, from there, I would have to create a third “repository/script” that is responsible for joining the applications in a similar way to the Nginx script I have, or can this be done natively with Railway?
Regarding costs, how different would it be compared to me creating a Docker container that runs everything as a monolith with the routing I already have?
I’m interested in keeping everything separate (as microservices) because if I need to add new features, I would only have to update my GitHub code and Railway would take care of the rest, and I would have a more real separation than having all the code in a single Docker container.
I would like to know if there are other options that you know of, thank you for your help!
There is a code snippet of how i handle the reverse proxy with nginx
def generate_nginx_config(modules: List[ModuleType]) -> str:
config = """
server {
listen 80;
server_name localhost;
"""
for module in modules:
module_name = get_module_name(module)
port = get_app_port(module)
prefix = get_app_prefix(module)
if port is None or prefix is None:
print(f"Error: No se pudo obtener el puerto o prefijo para {module_name}")
continue
config += f"""
location {prefix} {{
proxy_pass http://localhost:{port};
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}}
"""
print(f"Ruta de Nginx para {module_name}: http://localhost{prefix}")
config += "}n"
config_path = os.path.expanduser("~/dash_apps_nginx.conf")
with open(config_path, "w") as f:
f.write(config)
print(f"Configuración de Nginx generada en {config_path}")
return config_path