-
Notifications
You must be signed in to change notification settings - Fork 10
/
Dockerfile-for-api-server
36 lines (25 loc) · 1.03 KB
/
Dockerfile-for-api-server
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
# Copyright 2019-2023 Hitachi, Ltd., Hitachi America, Ltd. All Rights Reserved.
#
# SPDX-License-Identifier: Apache-2.0
ARG NODE_VERSION
FROM node:${NODE_VERSION} AS build
ARG FABRIC_VERSION
COPY opssc-api-server/src /opt/app/src
COPY common /opt/common
# Allow npm to run prepare script as root
RUN cd /opt/common/src; npm --unsafe-perm install
RUN cd /opt/app/src; npm --unsafe-perm install
# Download fabric binaries
RUN mkdir /opt/fabric
RUN cd /opt/fabric; \
curl -LO https://github.com/hyperledger/fabric/releases/download/v${FABRIC_VERSION}/hyperledger-fabric-linux-amd64-${FABRIC_VERSION}.tar.gz; \
tar -xzf hyperledger-fabric-linux-amd64-${FABRIC_VERSION}.tar.gz
FROM node:${NODE_VERSION}-slim
RUN mkdir /config
COPY --from=build /opt/fabric/config /config
COPY --from=build /opt/fabric/bin/peer /usr/local/bin
COPY --from=build /opt/common/src /opt/common/src
COPY --from=build /opt/app/src /opt/app/src
# Add fabric-configtx-cli
COPY configtx-cli/bin/fabric-configtx-cli /usr/local/bin
ENTRYPOINT cd /opt/app/src; npm start