forked from nestjs/schematics
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
50 lines (43 loc) · 1.25 KB
/
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
40
41
42
43
44
45
46
47
48
49
50
FROM node:carbon-alpine as dev-dependencies
WORKDIR /nestjs/schematics
COPY package.json package.json
COPY package-lock.json package-lock.json
COPY .npmignore .npmignore
RUN npm install
FROM node:carbon-alpine as prod-dependencies
WORKDIR /nestjs/schematics
COPY package.json package.json
COPY package-lock.json package-lock.json
COPY .npmignore .npmignore
RUN npm install --production
FROM node:carbon-alpine as linter
WORKDIR /nestjs/schematics
COPY --from=dev-dependencies /nestjs/schematics .
COPY src src
COPY test test
COPY tsconfig.json tsconfig.json
COPY tslint.json tslint.json
RUN npm run -s lint:src && npm run -s lint:test
FROM node:carbon-alpine as tester
WORKDIR /nestjs/schematics
COPY --from=linter /nestjs/schematics .
RUN npm test -s
FROM node:carbon-alpine as builder
WORKDIR /nestjs/schematics
COPY --from=tester /nestjs/schematics .
RUN npm run -s build
FROM node:carbon-alpine
RUN npm install -g @angular-devkit/schematics-cli
WORKDIR /nestjs/schematics
COPY --from=prod-dependencies /nestjs/schematics .
COPY --from=builder /nestjs/schematics/dist .
COPY src/collection.json collection.json
COPY LICENSE LICENSE
COPY README.md README.md
COPY .npmignore .npmignore
COPY src .
RUN ls
RUN npm link
WORKDIR /workspace
VOLUME [ "/workspace" ]
CMD [ "/bin/sh" ]