-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
46 lines (31 loc) · 1.07 KB
/
Dockerfile
File metadata and controls
46 lines (31 loc) · 1.07 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
FROM node:11
# Copy Fabric network dependency
COPY chain/basic-network /usr/src/chain/basic-network
# Install Fabric NR dependency
COPY chain/docrec /usr/src/chain/docrec
WORKDIR /usr/src/chain/docrec
# Install dependencies in docrec folder
# A wildcard is used to ensure both package.json AND package-lock.json are copied
# where available (npm@5+)
COPY api/package*.json ./
RUN npm install
RUN node enrollAdmin.js
RUN node registerUser.js alice
# Extract alice cert for validation
RUN cat ./wallet/alice/alice | grep -Po '\-.*\-' | awk '{gsub(/\\n/,"\n")}1' >> ./wallet/alicecert
VOLUME /usr/src/chain
# Create app directory
WORKDIR /usr/src/api
# Copy cert for accessing bucket. To be refed in compose.
COPY ./bucket/certs/nr.crt nr.crt
# Copy keys for ssh access to selinux machine.
COPY ./selinux/_vagrant/keys ../selinux/_vagrant/keys
RUN chmod -R og-rw ../selinux/_vagrant/keys/*
# Install app dependencies
COPY api/package*.json ./
RUN npm install
# If you are building your code for production
# RUN npm ci --only=production
COPY api .
EXPOSE 3010
CMD [ "npm", "start" ]