Skip to content

Instantly share code, notes, and snippets.

@varqasim
Created January 23, 2021 23:02
Show Gist options
  • Save varqasim/5e17a5d566f1d0b19ca9c93bcdb91074 to your computer and use it in GitHub Desktop.
Save varqasim/5e17a5d566f1d0b19ca9c93bcdb91074 to your computer and use it in GitHub Desktop.
NodeJS "Hello World" Dockerised App
var express = require('express');
var app = express();
var PORT = 3000;
app.get('/', (req, res) => {
res.send("Hello World")
})
app.listen(PORT, function(err){
if (err) console.log(err);
console.log("Server listening on PORT", PORT);
});
FROM node:12.16.3-alpine
COPY package.json package-lock*.json ./
RUN npm install
COPY . .
RUN npm run build
CMD ["npm", "run", "start"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment