Dockerfile 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. # This file was auto-generated, do not edit it directly.
  2. # Instead run bin/update_build_scripts from
  3. # https://github.com/overleaf/internal/
  4. FROM node:24.14.1 AS base
  5. WORKDIR /overleaf/services/history-v1
  6. ENV PATH="/overleaf/node_modules/.bin:$PATH"
  7. RUN corepack enable
  8. COPY services/history-v1/install_deps.sh /overleaf/services/history-v1/
  9. RUN chmod 0755 ./install_deps.sh && ./install_deps.sh
  10. # Google Cloud Storage needs a writable $HOME/.config for resumable uploads
  11. # (see https://googleapis.dev/nodejs/storage/latest/File.html#createWriteStream)
  12. RUN mkdir /home/node/.config && chown node:node /home/node/.config
  13. # fs persistor needs a writable folder as a target for the mounted volume
  14. RUN mkdir /buckets && chown node:node /buckets
  15. FROM base AS app
  16. COPY package.json yarn.lock .yarnrc.yml /overleaf/
  17. COPY libraries/fetch-utils/package.json /overleaf/libraries/fetch-utils/package.json
  18. COPY libraries/logger/package.json /overleaf/libraries/logger/package.json
  19. COPY libraries/metrics/package.json /overleaf/libraries/metrics/package.json
  20. COPY libraries/mongo-utils/package.json /overleaf/libraries/mongo-utils/package.json
  21. COPY libraries/o-error/package.json /overleaf/libraries/o-error/package.json
  22. COPY libraries/object-persistor/package.json /overleaf/libraries/object-persistor/package.json
  23. COPY libraries/overleaf-editor-core/package.json /overleaf/libraries/overleaf-editor-core/package.json
  24. COPY libraries/promise-utils/package.json /overleaf/libraries/promise-utils/package.json
  25. COPY libraries/redis-wrapper/package.json /overleaf/libraries/redis-wrapper/package.json
  26. COPY libraries/settings/package.json /overleaf/libraries/settings/package.json
  27. COPY libraries/stream-utils/package.json /overleaf/libraries/stream-utils/package.json
  28. COPY libraries/validation-tools/package.json /overleaf/libraries/validation-tools/package.json
  29. COPY services/history-v1/package.json /overleaf/services/history-v1/package.json
  30. COPY tools/migrations/package.json /overleaf/tools/migrations/package.json
  31. COPY .yarn/patches/ /overleaf/.yarn/patches/
  32. COPY tools/migrations/ /overleaf/tools/migrations/
  33. RUN cd /overleaf && yarn workspaces focus overleaf-editor overleaf
  34. COPY libraries/fetch-utils/ /overleaf/libraries/fetch-utils/
  35. COPY libraries/logger/ /overleaf/libraries/logger/
  36. COPY libraries/metrics/ /overleaf/libraries/metrics/
  37. COPY libraries/mongo-utils/ /overleaf/libraries/mongo-utils/
  38. COPY libraries/o-error/ /overleaf/libraries/o-error/
  39. COPY libraries/object-persistor/ /overleaf/libraries/object-persistor/
  40. COPY libraries/overleaf-editor-core/ /overleaf/libraries/overleaf-editor-core/
  41. COPY libraries/promise-utils/ /overleaf/libraries/promise-utils/
  42. COPY libraries/redis-wrapper/ /overleaf/libraries/redis-wrapper/
  43. COPY libraries/settings/ /overleaf/libraries/settings/
  44. COPY libraries/stream-utils/ /overleaf/libraries/stream-utils/
  45. COPY libraries/validation-tools/ /overleaf/libraries/validation-tools/
  46. COPY services/history-v1/ /overleaf/services/history-v1/
  47. COPY tools/migrations/ /overleaf/tools/migrations/
  48. FROM app
  49. USER node
  50. CMD ["node", "--expose-gc", "app.js"]