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

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"]