app.js

const express = require("express");
const app = express();
const PORT = 8080;

app.get("/healthcheck", (req, res) => {
  res.json({ status: "ok" });
});

app.get("/v1/worldskills", (req, res) => {
  res.send("Cloud Computing");
});

app.get("/v1/gold", (req, res) => {
  res.send("I want Get Gold Medal!");
});

app.listen(PORT, () => {
  console.log(`Server is running on <http://localhost>:${PORT}`);
});

package.json

{
  "name": "app",
  "version": "1.0.0",
  "main": "app.js",
  "scripts": {
    "test": "echo \\"Error: no test specified\\" && exit 1"
  },
  "author": "",
  "license": "ISC",
  "description": "",
  "dependencies": {
    "express": "^4.21.2"
  }
}

Dockerfile

FROM node:18

WORKDIR /usr/src/app

COPY package.json ./

RUN apt-get update && apt-get install -y iputils-ping && npm install

COPY . .

EXPOSE 8080

CMD ["node", "app.js"]