A teammate added curl to the status page image so health checks can run inside the container. The build now fails. Fix it, then make the app start.
Build and read the failure. BuildKit prints the failing command's output and the Dockerfile lines around it:
node:20-alpine is Alpine Linux, so its package manager is apk. Replace the RUN line with RUN apk add --no-cache curl, press Save, and rebuild:
Run the image and read why it stops:
sh
docker run -d --name status -p 8080:3000 status-page:0.4
docker logs statusNothing installed the app's dependencies. Add RUN npm install after COPY . ., save, rebuild, and replace the container:
sh
docker build -t status-page:0.4 .
docker rm status
docker run -d --name status -p 8080:3000 status-page:0.4
docker exec status curl -s localhost:3000/health