-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathnodejs
29 lines (29 loc) · 897 Bytes
/
nodejs
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
#Get the base image to centos 7 from public docker registry
FROM Centos7
# File Author / Maintainer
MAINTAINER chennarao vemula <[email protected]>
# Install Node.js and other dependencies
RUN curl --silent --location https://rpm.nodesource.com/setup_5.x | bash - && \
curl --silent --location https://rpm.nodesource.com/setup_5.x | bash - && \
yum update -y && \
yum install -y nodejs gcc-c++ make && \
yum clean all -y && \
npm install -g gulp-cli bower
# Expose port
EXPOSE 8080
# Set env variables for node app
ENV OPENSHIFT_NODEJS_PORT 8080
ENV NODEJS_VERSION 5.x
# Define working directory and copy source files in
RUN mkdir -p /www
WORKDIR /www
COPY . /www
# install deps
RUN npm install && \
bower install --allow-root && \
gulp build
# run as non-root user
RUN chown -R 1001:1001 /www
USER 1001
# Run app using nodemon
CMD ["npm", "start"]