Dockerfile 1.2 KB

12345678910111213141516171819202122232425262728293031323334
  1. FROM node:16-alpine@sha256:004dbac84fed48e20f9888a23e32fa7cf83c2995e174a78d41d9a9dd1e051a20
  2. # npm needs a Python for some of the deps
  3. RUN apk add git python3 make build-base
  4. # Build ETH
  5. WORKDIR /usr/src/ethereum
  6. ADD ethereum .
  7. RUN --mount=type=cache,target=/home/node/.npm \
  8. npm ci
  9. # Build p2w-sdk in dir preserving directory structure
  10. WORKDIR /usr/src/third_party/pyth/p2w-sdk/js/
  11. COPY third_party/pyth/p2w-sdk/js/package.json third_party/pyth/p2w-sdk/js/package-lock.json .
  12. RUN --mount=type=cache,target=/root/.cache \
  13. --mount=type=cache,target=/root/.npm \
  14. npm ci
  15. COPY third_party/pyth/p2w-sdk/js .
  16. RUN --mount=type=cache,target=/root/.cache \
  17. --mount=type=cache,target=/root/.npm \
  18. npm run build
  19. # Build p2w-integration-observer
  20. WORKDIR /usr/src/third_party/pyth/p2w-integration-observer
  21. COPY third_party/pyth/p2w-integration-observer/package.json third_party/pyth/p2w-integration-observer/package-lock.json .
  22. RUN --mount=type=cache,target=/root/.cache \
  23. --mount=type=cache,target=/root/.npm \
  24. npm ci
  25. COPY third_party/pyth/p2w-integration-observer .
  26. RUN --mount=type=cache,target=/root/.cache \
  27. --mount=type=cache,target=/root/.npm \
  28. npm run build