Files
kuentagym/deploy
dsantillan 7271dadbee
Publish Docker images / build (., ./web/Dockerfile, web) (push) Canceled after 0s
Publish Docker images / build (./api, ./api/Dockerfile, api) (push) Canceled after 0s
The deploy path's nginx: re-resolve the api on every request
A plain `proxy_pass http://api:3000` is resolved once, when nginx starts, and the
address stays pinned for the life of the container. Recreate the api — a deploy that
changes its configuration, a --force-recreate, any restart that hands it a new IP — and
the web container keeps talking to a dead address: every /api call answers 502, including
/api/config, so the app cannot even boot. That is not hypothetical: it is what happened on
gym.dploy.lol, where restarting the api to pick up new code produced 502 on every endpoint
until the web container was restarted too.

The generated config now asks Docker's embedded DNS again on every request instead:
`resolver 127.0.0.11` plus `set $api_upstream http://api:3000` and `proxy_pass
$api_upstream`. This is the same fix web/nginx.conf.template has carried for the
registry-image shape (with a comment explaining issue #16), and comment 4 at the top of
this file now records why the deploy path needs it too.

Verified by rendering the command exactly as the container runs it and passing the result
through an nginx config parser: both body limits in place, both locations on the variable,
and the upstream still resolved through the embedded resolver.
2026-09-23 11:01:01 -04:00
..