The classic host/port issue after build -- node/express

Hey folks, I’m trying to debug the host/port issue after build. I understand why we need instead of just localhost/ My fly.toml and Dockerfile are clearly not setup correctly. Any tips?

app = 'camber-api'
primary_region = 'sjc'

internal_port = 3000
force_https = true
auto_stop_machines = true
auto_start_machines = true
min_machines_running = 0
type = "requests"
soft_limit = 200
hard_limit = 250

memory = '1gb'
cpu_kind = 'shared'
cpus = 1

NODE_ENV = "production"
PORT = "3000"
HOST = ""


FROM node:20.11.1-slim as base
ENV NODE_ENV=production

FROM base as build
RUN apt-get update && apt-get install -y graphicsmagick ghostscript
COPY package*.json ./
RUN npm ci --include=dev
COPY . .
RUN npm run build && npm prune --production

FROM base
COPY --from=build /app /app
CMD ["npm", "run", "start"]

index.js snippet

import express from "express";
import "dotenv/config";
const PORT = process.env.PORT || 3000;
const HOST = process.env.HOST || "";

const app = express(); // create the app

app.listen(PORT, HOST, () => console.log("Camber is live on port 3000")); 

Any tips appreciated. For what it’s worth, I also set the HOST and PORT in my app secrets just in case. This doesn’t seem to be the source, but to be complete, my start script looks like "start": "nodemon — exec babel-node index.js"

Added nodejs