502 Error after deploying Docker image using node:20-slim
prazeres-rafael
HOBBYOP

17 days ago

I’m facing a bizarre issue: everything works as expected locally, but when I deploy the Docker container on Railway, the deployment completes successfully with no errors — however, the website becomes inaccessible and returns a 502 error.

Image used:

FROM node:20-slim AS base

Image that works:

FROM node:20-alpine AS base

Sucess deploy in both:


Please help

Solved$10 Bounty

3 Replies

Railway
BOT

17 days ago

Hey there! We've found the following might help you get unblocked faster:

If you find the answer from one of these, please let us know by solving the thread!


bytekeim
PRO

17 days ago

Hy @prazeres-rafael, add this line in the runner stage of your slim Dockerfile (right before CMD or USER):

ENV HOSTNAME=0.0.0.0

and redeploy.


prazeres-rafael
HOBBYOP

17 days ago

Thanks @bytekeim! It's working!


Status changed to Solved brody 17 days ago


Loading...