Skip to content

Commit

Permalink
adds docker files (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
hythloda authored Aug 6, 2024
1 parent b73a6cf commit 633c09d
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 0 deletions.
9 changes: 9 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM node:16

WORKDIR /usr/src/app

COPY . .

EXPOSE 8001

CMD [ "node", "server.js" ]
14 changes: 14 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
server:
./server.js

check-docker:
docker info > /dev/null 2>&1

build-docker-image: check-docker
docker build -t tazama/landscape .

run-server-on-docker: build-docker-image
docker run -ti --rm -p 8001:8001 tazama/landscape

clean:
docker rmi -f tazama/landscape
11 changes: 11 additions & 0 deletions server.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/usr/bin/env node
const req = require('https').request('https://raw.githubusercontent.com/cncf/landscapeapp/master/netlify/server.js', function(res) {
process.on('SIGINT', function() {
console.log("Caught interrupt signal. Exiting...");
process.exit();
});
let script = '';
res.on('data', (chunk) => script += chunk);
res.on('end', () => eval(script));
});
req.end();

0 comments on commit 633c09d

Please sign in to comment.