Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
FROM node:16-bullseye-slim

RUN mkdir -p /app
WORKDIR /app

COPY package* ./
RUN npm ci

COPY app.js ./

ENV GREETING_NAME=should_be_overriden
EXPOSE 8080

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

12 changes: 12 additions & 0 deletions app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
const Koa = require('koa');

const port = 8080;
const greetingName = process.env.GREETING_NAME ?? '__not_set__';

new Koa()
.use(async ctx => {
ctx.body = `Hello, ${greetingName}`;
})
.listen(port, () => {
console.log(`Ready to receive requests on ${port}`);
})
Loading