Skip to content

Commit

Permalink
Nonroot User in Docker Image
Browse files Browse the repository at this point in the history
Signed-off-by: hfuss <hayden.fuss@kaleido.io>
  • Loading branch information
onelapahead committed Oct 10, 2023
1 parent da70185 commit 4d90cff
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 4d90cff

Please sign in to comment.