Dockerfile 972 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. FROM node:16-alpine AS node
  2. FROM node AS node-with-gyp
  3. RUN apk add g++ make python3
  4. FROM node-with-gyp AS builder
  5. WORKDIR /squid
  6. ADD package.json .
  7. ADD package-lock.json .
  8. ADD assets assets
  9. RUN npm ci
  10. ADD tsconfig.json .
  11. ADD src src
  12. ADD schema schema
  13. RUN npx squid-typeorm-codegen
  14. RUN npm run build
  15. FROM node-with-gyp AS deps
  16. WORKDIR /squid
  17. ADD package.json .
  18. ADD package-lock.json .
  19. ADD assets assets
  20. RUN npm ci --production
  21. FROM node AS squid
  22. WORKDIR /squid
  23. COPY --from=deps /squid/package.json .
  24. COPY --from=deps /squid/package-lock.json .
  25. COPY --from=deps /squid/node_modules node_modules
  26. COPY --from=builder /squid/lib lib
  27. RUN echo -e "loglevel=silent\nupdate-notifier=false" > /squid/.npmrc
  28. ADD db db
  29. ADD assets assets
  30. ADD schema schema
  31. # TODO: use shorter PROMETHEUS_PORT
  32. ENV PROCESSOR_PROMETHEUS_PORT 3000
  33. EXPOSE 3000
  34. EXPOSE 4000
  35. FROM squid AS processor
  36. CMD ["npm", "run", "processor-start"]
  37. FROM squid AS query-node
  38. CMD ["npm", "run", "query-node-start"]