This repository was archived by the owner on Nov 3, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
62 lines (47 loc) · 1.65 KB
/
Copy pathDockerfile
File metadata and controls
62 lines (47 loc) · 1.65 KB
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
FROM ubuntu:latest as builder
# Install wget and unzip
RUN apt-get -qq update && \
apt-get -qq install -y \
wget \
unzip \
nodejs \
npm \
git
# BCF Converter
RUN wget --quiet https://github.com/bimspot/bcf-converter/releases/download/0.0.1/bcf-converter-linux-x64.tar.gz
RUN tar -zxvf bcf-converter-linux-x64.tar.gz
RUN chmod +x bcf-converter-linux-x64/bcf-converter
ARG NODE_ENV=development
ENV NODE_ENV $NODE_ENV
# Snyk token for authentication
ENV SNYK_TOKEN=feb696b3-0d7f-4589-8327-fe6a8064c285
# So that locally installed packages are available on the PATH
ENV PATH /home/node/node_modules/.bin:$PATH
RUN npm config set unsafe-perm true
WORKDIR /home/node
# Installing dependencies
COPY ./src/package.json /home/node/
RUN npm install --quiet
RUN npm install -g nodemon --quiet --unsafe-perm=true
COPY ./src/ /home/node/
# Creating folders for generated documenation and test results
RUN mkdir -p docs artifacts
# Running eslint. Image will not build without confirming to style guide.
RUN eslint *.js
# ----------------------------------------------------------------------------
# Production container
# ----------------------------------------------------------------------------
FROM mcr.microsoft.com/dotnet/core/runtime:2.2-bionic
RUN apt-get -qq update && apt-get -qq install -y \
nodejs \
npm \
git
RUN npm install npm@latest -g
RUN npm install bimspot/xeokit-gltf-to-xkt#cli -g
# Converting tools
COPY --from=builder /bcf-converter-linux-x64/ /usr/lib/bcf-converter
RUN ln -s /usr/lib/bcf-converter/bcf-converter /usr/local/bin/bcf-converter
WORKDIR /home/node
COPY ./src/ /home/node/
RUN npm install --production
CMD ["node", "index.js"]