forked from Node-DC/Node-DC-EIS
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile-node-cluster
More file actions
29 lines (19 loc) · 826 Bytes
/
Copy pathDockerfile-node-cluster
File metadata and controls
29 lines (19 loc) · 826 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
FROM node:6.10
MAINTAINER Sushma Thimmappa(sushma.kyasaralli.thimmappa@intel.com)
#Install necessary preliminary packages
RUN apt-get update && apt-get install -y sudo && apt-get -y install vim
#Create a user to be able to run node commands
RUN useradd -m nodeuser && echo "nodeuser:12345"|chpasswd && adduser nodeuser sudo
#Move to user's dir as current working directory
WORKDIR /home/nodeuser/Node-DC-EIS-cluster
#Copy the server related files to the container
ADD Node-DC-EIS-cluster /home/nodeuser/Node-DC-EIS-cluster/
#Setting user permissions for the files
RUN chown -R nodeuser:nodeuser /home/nodeuser/Node-DC-EIS-cluster
RUN npm install
#Switch to user (was root until now)
USER nodeuser
#expose the port to be visible outside container
EXPOSE 9000
#start the node server
CMD ["node", "server-cluster.js"]