aboutsummaryrefslogtreecommitdiffstats
path: root/Dockerfile
blob: 744bf65bec53b7b6caf13df7f09b1048987b7508 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
FROM node:4.6.0
MAINTAINER maintainer
ENV INSROOT  /opt/app
ENV APPUSER dispatcher
RUN mkdir -p ${INSROOT}/${APPUSER}/lib \
    && mkdir -p ${INSROOT}/${APPUSER}/etc \
      && mkdir -p ${INSROOT}/${APPUSER}/log \
    &&  useradd -d ${INSROOT}/${APPUSER}  ${APPUSER}
COPY *.js ${INSROOT}/${APPUSER}/
COPY package.json ${INSROOT}/${APPUSER}/
COPY lib ${INSROOT}/${APPUSER}/lib/
COPY etc/config.json.docker ${INSROOT}/${APPUSER}/etc/config.json
COPY etc/log4js.json ${INSROOT}/${APPUSER}/etc/log4js.json
WORKDIR ${INSROOT}/${APPUSER}
RUN npm install --production && chown -R ${APPUSER}:${APPUSER} ${INSROOT}/${APPUSER} && npm remove -g npm
USER ${APPUSER}
VOLUME ${INSROOT}/${APPUSER}/log
EXPOSE 8443
ENTRYPOINT ["/usr/local/bin/node", "dispatcher.js"]