-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
47 lines (39 loc) · 1.31 KB
/
Dockerfile
File metadata and controls
47 lines (39 loc) · 1.31 KB
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
FROM hyperledger/fabric-tools:2.2.15
RUN apk update && apk add --update --no-cache python3 make g++
RUN apk add --no-cache nodejs npm
RUN node -v
# Telnet
RUN apk add --no-cache busybox-extras
#Create folder /app and working with /app folder
RUN mkdir -p /data/app
# set our node environment, either development or production
# defaults to production, compose overrides this to development on build and run
ARG NODE_ENV=production
ENV NODE_ENV $NODE_ENV
# default to port 3000 for node, and 5858 or 9229 for debug
ARG PORT=4001
ENV PORT $PORT
EXPOSE $PORT
# check every 30s to ensure this service returns HTTP 200
#HEALTHCHECK CMD curl -fs http://localhost:$PORT/healthz || exit 1
#Copy packages.json to /app folder && Install npm base on packages.json
WORKDIR /data
RUN npm install -g nodemon
# COPY package.json package-lock.json* ./
# RUN npm install && npm cache clean --force
ENV PATH /data/node_modules/.bin:$PATH
#Copy source code to app
WORKDIR /data/app
RUN mkdir node_modules
# COPY fabric-sdk-node/fabric-client /data/app/node_modules
COPY package.json /data/app
RUN npm install && npm cache clean --force
RUN apk add curl
COPY . /data/app
#Default on container port is 3000
EXPOSE 4001
#Chaincode seting
RUN mkdir -p /go/src/
ENV GOPATH /go
CMD npm start
# CMD tail -f /dev/null