mirror of
https://github.com/hyperledger/fabric-samples.git
synced 2026-06-17 15:35:09 +00:00
Update Node.js dockerfile (#805)
Signed-off-by: Matthew B White <whitemat@uk.ibm.com>
This commit is contained in:
parent
41717d76f2
commit
4bbffdf2f2
2 changed files with 6 additions and 3 deletions
1
asset-transfer-basic/chaincode-typescript/.dockerignore
Normal file
1
asset-transfer-basic/chaincode-typescript/.dockerignore
Normal file
|
|
@ -0,0 +1 @@
|
|||
node_modules
|
||||
|
|
@ -7,6 +7,7 @@ WORKDIR /usr/src/app
|
|||
|
||||
# Copy node.js source and build, changing owner as well
|
||||
COPY --chown=node:node . /usr/src/app
|
||||
ENV npm_config_cache=/usr/src/app
|
||||
RUN npm ci && npm run package
|
||||
|
||||
|
||||
|
|
@ -15,16 +16,17 @@ ARG CC_SERVER_PORT
|
|||
|
||||
# Setup tini to work better handle signals
|
||||
ENV TINI_VERSION v0.19.0
|
||||
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /tini
|
||||
ENV PLATFORM=amd64
|
||||
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini-${PLATFORM} /tini
|
||||
RUN chmod +x /tini
|
||||
|
||||
|
||||
WORKDIR /usr/src/app
|
||||
COPY --chown=node:node --from=builder /usr/src/app/dist ./dist
|
||||
COPY --chown=node:node --from=builder /usr/src/app/package.json ./
|
||||
COPY --chown=node:node --from=builder /usr/src/app/npm-shrinkwrap.json ./
|
||||
COPY --chown=node:node docker/docker-entrypoint.sh /usr/src/app/docker-entrypoint.sh
|
||||
RUN npm ci --only=production
|
||||
|
||||
RUN npm ci --omit=dev && npm cache clean --force
|
||||
|
||||
ENV PORT $CC_SERVER_PORT
|
||||
EXPOSE $CC_SERVER_PORT
|
||||
|
|
|
|||
Loading…
Reference in a new issue