forked from aka-msft/helium
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
39 lines (35 loc) · 1000 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
37
38
39
# ---- Base Node ----
FROM node:dubnium-alpine AS base
WORKDIR /app
COPY scripts ./scripts
RUN chmod +x ./scripts/start-service.sh
EXPOSE 3000
COPY package.json .
#
# ---- Dependencies ----
FROM base AS dependencies
RUN npm set progress=false && npm config set depth 0
RUN npm install --production
RUN cp -R node_modules prod_node_modules
RUN npm install
#
# ---- Test ----
# run linters, setup and tests
FROM dependencies AS test
COPY . .
RUN npm run lint && npm run build && npm run test-unit
#
# ---- Release ----
FROM base AS release
COPY --from=dependencies /app/prod_node_modules ./node_modules
COPY --from=test /app/dist ./dist
ENTRYPOINT [ "sh", "./scripts/start-service.sh" ]
#
# ---- Integration Test ----
# run integration tests
FROM dependencies AS integration
ARG integration_server_url=localhost:3000
ENV integration_server_url=${integration_server_url}
COPY . .
COPY --from=dependencies /app/prod_node_modules ./node_modules
ENTRYPOINT [ "sh", "./scripts/run-integration.sh" ]