aboutsummaryrefslogtreecommitdiffstats
path: root/Dockerfile_UT
blob: ee5791d9bba10288d06540ee9176dddaceb6db3e (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
35
36
37
FROM node:10.16.0

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

WORKDIR ${APPDIR}

RUN uname -a \
 && 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 *.txt ${APPDIR}/
COPY *.yaml ${APPDIR}/
COPY ./lib/ ${APPDIR}/lib/
COPY ./tests/ ${APPDIR}/tests/
COPY ./etc/ ${APPDIR}/etc/

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

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