apps.Dockerfile 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. FROM mikefarah/yq as manifest-maker
  2. # Change metadata.source in manifest file. It's not possible to override it via flag/env.
  3. USER root
  4. ARG WS_PROVIDER_ENDPOINT_URI
  5. COPY ./query-node/manifest.yml /joystream/qn-manifest.yml
  6. RUN yq e -i ".typegen.metadata.source = \"$WS_PROVIDER_ENDPOINT_URI\"" /joystream/qn-manifest.yml
  7. FROM --platform=linux/x86-64 node:14 as builder
  8. WORKDIR /joystream
  9. COPY . /joystream
  10. COPY --from=manifest-maker /joystream/qn-manifest.yml /joystream/query-node/manifest.yml
  11. RUN rm -fr /joystream/pioneer
  12. # Do not set NODE_ENV=production until after running yarn install
  13. # to ensure dev dependencies are installed.
  14. RUN yarn --forzen-lockfile
  15. RUN yarn workspace @joystream/types build
  16. RUN yarn workspace @joystream/metadata-protobuf build
  17. RUN yarn workspace query-node-root build
  18. # Second stage to reduce image size, enable it when
  19. # all packages have correctly identified what is a devDependency and what is not.
  20. # It will reduce the image size by about 500MB (down from 2.2GB to 1.7GB)
  21. # # Remove files that are not needed after build.
  22. # # We will re-fetch only dependencies needed for running the apps.
  23. # RUN rm -fr node_modules/
  24. # RUN rm -fr .git/
  25. # FROM node:12
  26. # WORKDIR /joystream
  27. # COPY --from=builder /joystream/ /joystream/
  28. # # Skip installing devDependencies, since we have already built the packages.
  29. # ENV NODE_ENV=production
  30. # RUN yarn install --forzen-lockfile --production
  31. ENTRYPOINT [ "yarn" ]