aboutsummaryrefslogtreecommitdiffstats
path: root/Dockerfile_UT
blob: df4ddac86785cc83cc18f3b2f10178cd92cf8fdd (plain)
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
30
31
32
33
34
FROM node:6.10.3

ENV INSROOT /opt/app
ENV APPUSER dh
ENV APPDIR ${INSROOT}/${APPUSER}

WORKDIR ${APPDIR}

RUN mkdir -p ${APPDIR}/lib \
 && mkdir -p ${APPDIR}/tests \
 && mkdir -p ${APPDIR}/etc \
 && mkdir -p ${APPDIR}/log \
 && useradd -d ${APPDIR} ${APPUSER}

COPY *.js ${APPDIR}/
COPY *.json ${APPDIR}/
COPY *.yaml ${APPDIR}/
COPY ./lib/ ${APPDIR}/lib/
COPY ./tests/ ${APPDIR}/tests/
COPY ./etc/log4js.json ${APPDIR}/etc/log4js.json

RUN npm install \
 && chown -R ${APPUSER}:${APPUSER} ${APPDIR} \
 && chmod 777 ${APPDIR}/lib \
 && chmod 777 ${APPDIR}/tests \
 && chmod 777 ${APPDIR}/log \
 && chmod 777 ${APPDIR}/etc \
 && ls -la && ls -la ./tests

USER ${APPUSER}
VOLUME ${APPDIR}/log
EXPOSE 8443
ENTRYPOINT ["/usr/local/bin/npm", "test"]
# ENTRYPOINT ["/usr/local/bin/npm", "run", "test-only"]