apps.Dockerfile 861 B

1234567891011121314151617181920212223242526272829
  1. FROM node:12 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 query-node-root build
  10. RUN yarn workspace storage-node build
  11. # Remove files that are not needed after build.
  12. # We will re-fetch only dependencies needed for running the apps.
  13. RUN rm -fr node_modules/
  14. RUN rm -fr .git/
  15. FROM node:12
  16. WORKDIR /joystream
  17. COPY --from=builder /joystream/ /joystream/
  18. # Skip installing devDependencies, since we have already built the packages.
  19. # Important to make sure packages have correctly identified what is a devDependency and what is not.
  20. ENV NODE_ENV=production
  21. RUN yarn install --forzen-lockfile --production
  22. ENTRYPOINT [ "yarn" ]