forked from Rottschaferanders/LaserWeb4
-
Notifications
You must be signed in to change notification settings - Fork 7
/
Dockerfile
36 lines (32 loc) · 877 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
35
36
#
# ---- Base Node ----
FROM node:10-alpine AS base
# set working directory
WORKDIR /usr/src/app
# copy project file
COPY package*.json ./
EXPOSE 8000
# copy app sources
COPY . .
#
# ---- Dependencies ----
FROM base AS dependencies
RUN apk add --no-cache libusb-dev eudev-dev make gcc g++ python python3 linux-headers udev git
RUN git config --global url."https://github.com".insteadOf "ssh://[email protected]"
# install node packages
RUN npm set progress=false && npm config set depth 0
RUN npm ci
#
# ---- Test ----
# run linters, setup and tests
FROM dependencies AS test
#RUN npm run lint && npm run setup && npm run test
RUN npm run test
#
# ---- Dev ----
FROM dependencies AS dev
RUN npm install && npm install -g nodemon
# copy production node_modules
COPY --from=dependencies /usr/src/app/node_modules node_modules
# define CMD
CMD [ "npm", "run", "start-server" ]