fix(deploy): allow dev and prod stacks on the same Dokploy server
Stop publishing web on host port 8080, which clashed between stacks; Traefik reaches port 80 of the container through dokploy-network. Local testing now uses docker-compose.local.yml to publish the port. Proxy nginx to a `gruperly-api` alias that only exists on the stack's own network: the `api` service name is also registered on dokploy-network, so with two stacks nginx could reach the other environment's API. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -3,8 +3,10 @@
|
||||
# Con el proxy, el navegador pega siempre al mismo origen: la cookie de sesión
|
||||
# es first-party y el CORS del backend queda como red de seguridad.
|
||||
|
||||
# DNS interno de Docker: resuelve `api` en cada request, así el proxy sobrevive
|
||||
# a un recreate del contenedor (que cambia la IP).
|
||||
# DNS interno de Docker: resuelve `gruperly-api` en cada request, así el proxy
|
||||
# sobrevive a un recreate del contenedor (que cambia la IP). Es un alias que el
|
||||
# compose define solo en la red propia del stack; `api` también existe en
|
||||
# dokploy-network y con dev y prod en el mismo server resolvería a cualquiera.
|
||||
resolver 127.0.0.11 valid=10s ipv6=off;
|
||||
|
||||
server {
|
||||
@@ -18,7 +20,7 @@ server {
|
||||
|
||||
# ── API ────────────────────────────────────────────────────────────────────
|
||||
location /api/ {
|
||||
set $api http://api:4000;
|
||||
set $api http://gruperly-api:4000;
|
||||
proxy_pass $api$request_uri;
|
||||
|
||||
proxy_http_version 1.1;
|
||||
|
||||
Reference in New Issue
Block a user