Created
January 23, 2021 23:02
-
-
Save varqasim/5e17a5d566f1d0b19ca9c93bcdb91074 to your computer and use it in GitHub Desktop.
NodeJS "Hello World" Dockerised App
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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