Skip to content

Commit

Permalink
Merge pull request #133 from kaleido-io/nonroot
Browse files Browse the repository at this point in the history
Nonroot User in Docker Image
  • Loading branch information
nguyer authored Oct 12, 2023
2 parents 1be9caa + ace933f commit 6f759a2
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,15 @@ RUN npm run build

FROM node:16-alpine3.15
RUN apk add curl
WORKDIR /root
WORKDIR /app
ADD package*.json ./
RUN npm install --production
COPY --from=solidity-builder /home/node/contracts contracts/source
COPY --from=solidity-builder /home/node/artifacts/contracts/ERC1155MixedFungible.sol contracts
COPY --from=builder /root/dist dist
COPY --from=builder /root/.env /root/.env
COPY --from=builder /root/.env /app/.env
RUN chgrp -R 0 /app/ \
&& chmod -R g+rwX /app/
USER 1001
EXPOSE 3000
CMD ["npm", "run", "start:prod"]
CMD ["node", "dist/src/main"]

0 comments on commit 6f759a2

Please sign in to comment.