forked from lapwinglabs/kev
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
34 lines (28 loc) · 897 Bytes
/
Dockerfile
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 debian:latest
RUN apt-get update && \
apt-get install -y curl xz-utils && \
curl -fsSL https://nodejs.org/dist/v14.16.0/node-v14.16.0-linux-x64.tar.xz -o node.tar.xz && \
tar -xf node.tar.xz -C /usr/local --strip-components=1 && \
rm node.tar.xz && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
ENV PATH=$PATH:/usr/src/node_modules/.bin
ARG NODE_ENV=test
# Install app
ENV NODE_ENV=$NODE_ENV
ENV NODE_PATH=/usr/src/kev
ADD package.json package-lock.json /tmp/
RUN cd /tmp && \
# npm cache clean --force && \
npm install && \
rm -rf /root/.npm && \
mkdir -p /usr/src/kev && \
ln -sf /tmp/node_modules /usr/src/kev/node_modules && \
ln -sf /tmp/package.json /usr/src/kev/package.json
# Add source
WORKDIR /usr/src/kev
COPY .npmrc /usr/src/kev/.npmrc
COPY src /usr/src/kev/src
ENTRYPOINT [ "npm", "run" ]
# Default command
CMD [ "test" ]