-
Notifications
You must be signed in to change notification settings - Fork 45
/
Copy pathfabricDriver.dockerfile.local
50 lines (34 loc) · 1.15 KB
/
fabricDriver.dockerfile.local
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
ARG BUILD_TAG
# Local Build
FROM node:16 AS builder-local
WORKDIR /fabric-driver
ADD protos-js /fabric-driver/protos-js
ADD weaver-fabric-interop-sdk /fabric-driver/weaver-fabric-interop-sdk
ADD package.json .
RUN npm install --unsafe-perm
ADD server /fabric-driver/server
ADD constants /fabric-driver/constants
ADD config.json .
ADD tsconfig.json .
ADD .eslintrc .
ADD .prettierrc .
RUN npm run build
FROM builder-${BUILD_TAG} AS builder
RUN rm -rf node_modules
RUN npm ci --only=production
FROM node:16-alpine AS prod
RUN addgroup -g 1001 relay
RUN adduser -D -s /bin/sh -u 1001 -G relay relay
ENV NODE_ENV production
WORKDIR /fabric-driver
ADD package.json .
ADD protos-js /fabric-driver/protos-js
ADD weaver-fabric-interop-sdk /fabric-driver/weaver-fabric-interop-sdk
COPY --from=builder /fabric-driver/package-lock.json /fabric-driver/
COPY --from=builder /fabric-driver/node_modules /fabric-driver/node_modules
COPY --from=builder /fabric-driver/out /fabric-driver/out
COPY --from=builder /fabric-driver/constants /fabric-driver/constants
RUN chown -R relay:relay /fabric-driver
USER relay
ARG GIT_URL
LABEL org.opencontainers.image.source ${GIT_URL}