Running a containerized API
Your task
Run a small Node API in a container. A /health request should return {"ok": true}. What to do: complete Dockerfile and src/server.js. Note: the app reads the PORT environment variable. It is checked from outside the container at localhost:<port>/health.
Ground rules
- •Keep the app as a Node standard HTTP server.
- •Include only files needed to run the app.
Not required
- •Auth, database, log collection.
- •Extra routes.
▶About this challenge
This exercise asks you to make a web service ready to receive requests in a containerized runtime.
A server that works locally still needs its runtime and network-facing settings aligned when it runs inside a container.
- What does this practice?
- It practices matching server startup behavior with container runtime conditions.
- Which files matter most?
- Review the Dockerfile together with the server startup code.