Parth Dave

Parth Dave

  • NA
  • 858
  • 715.6k

Node Js not running in Docker Environment

Oct 25 2017 8:59 AM

My Node Js is not running in Docker Environment.Specifically, my Express module is not loaded in the Docker. Please help me out on this issue.

Please give me your mail id so that I can send my code for verification.
 server.js
 
var express = require('express')
var app = express();
app.get('/', function (req, res) {
res.end('Hello world');
})
var server = app.listen(9005, function () {
var host = server.address().address
var port = server.address().port
console.log("Example app listening at http://%s:%s", host, port)
})
 Dockerfile
 
FROM stefanscherer/node-windows:7.6.0-nano
# Create app directory
RUN mkdir -p /app
WORKDIR /app
# Install app dependencies
COPY package.json /app/
RUN npm install
# Bundle app source
COPY . /app
CMD ["node","server.js"]
EXPOSE 9005
 

Answers (1)