apps.Dockerfile 1.0 KB

123456789101112131415161718192021222324252627282930313233
  1. FROM --platform=linux/x86-64 node:14 as builder
  2. WORKDIR /joystream
  3. COPY . /joystream
  4. RUN rm -fr /joystream/pioneer
  5. # Do not set NODE_ENV=production until after running yarn install
  6. # to ensure dev dependencies are installed.
  7. RUN yarn --forzen-lockfile
  8. RUN yarn workspace @joystream/types build
  9. RUN yarn workspace @joystream/metadata-protobuf build
  10. RUN yarn workspace query-node-root build
  11. # Second stage to reduce image size, enable it when
  12. # all packages have correctly identified what is a devDependency and what is not.
  13. # It will reduce the image size by about 500MB (down from 2.2GB to 1.7GB)
  14. # # Remove files that are not needed after build.
  15. # # We will re-fetch only dependencies needed for running the apps.
  16. # RUN rm -fr node_modules/
  17. # RUN rm -fr .git/
  18. # FROM node:12
  19. # WORKDIR /joystream
  20. # COPY --from=builder /joystream/ /joystream/
  21. # # Skip installing devDependencies, since we have already built the packages.
  22. # ENV NODE_ENV=production
  23. # RUN yarn install --forzen-lockfile --production
  24. ENTRYPOINT [ "yarn" ]