Dockerfile 924 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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. RUN npm run build
  13. FROM node-with-gyp AS deps
  14. WORKDIR /squid
  15. ADD package.json .
  16. ADD package-lock.json .
  17. ADD assets assets
  18. RUN npm ci --production
  19. FROM node AS squid
  20. WORKDIR /squid
  21. COPY --from=deps /squid/package.json .
  22. COPY --from=deps /squid/package-lock.json .
  23. COPY --from=deps /squid/node_modules node_modules
  24. COPY --from=builder /squid/lib lib
  25. RUN echo -e "loglevel=silent\nupdate-notifier=false" > /squid/.npmrc
  26. ADD db db
  27. ADD assets assets
  28. ADD schema schema
  29. # TODO: use shorter PROMETHEUS_PORT
  30. ENV PROCESSOR_PROMETHEUS_PORT 3000
  31. EXPOSE 3000
  32. EXPOSE 4000
  33. FROM squid AS processor
  34. CMD ["npm", "run", "processor-start"]
  35. FROM squid AS query-node
  36. CMD ["npm", "run", "query-node-start"]