Dockerfile 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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. COPY services/history-v1/install_deps.sh /overleaf/services/history-v1/
  7. RUN chmod 0755 ./install_deps.sh && ./install_deps.sh
  8. # Google Cloud Storage needs a writable $HOME/.config for resumable uploads
  9. # (see https://googleapis.dev/nodejs/storage/latest/File.html#createWriteStream)
  10. RUN mkdir /home/node/.config && chown node:node /home/node/.config
  11. # fs persistor needs a writable folder as a target for the mounted volume
  12. RUN mkdir /buckets && chown node:node /buckets
  13. FROM base AS app
  14. COPY package.json package-lock.json /overleaf/
  15. COPY libraries/fetch-utils/package.json /overleaf/libraries/fetch-utils/package.json
  16. COPY libraries/logger/package.json /overleaf/libraries/logger/package.json
  17. COPY libraries/metrics/package.json /overleaf/libraries/metrics/package.json
  18. COPY libraries/mongo-utils/package.json /overleaf/libraries/mongo-utils/package.json
  19. COPY libraries/o-error/package.json /overleaf/libraries/o-error/package.json
  20. COPY libraries/object-persistor/package.json /overleaf/libraries/object-persistor/package.json
  21. COPY libraries/overleaf-editor-core/package.json /overleaf/libraries/overleaf-editor-core/package.json
  22. COPY libraries/promise-utils/package.json /overleaf/libraries/promise-utils/package.json
  23. COPY libraries/redis-wrapper/package.json /overleaf/libraries/redis-wrapper/package.json
  24. COPY libraries/settings/package.json /overleaf/libraries/settings/package.json
  25. COPY libraries/stream-utils/package.json /overleaf/libraries/stream-utils/package.json
  26. COPY libraries/validation-tools/package.json /overleaf/libraries/validation-tools/package.json
  27. COPY services/history-v1/package.json /overleaf/services/history-v1/package.json
  28. COPY tools/migrations/package.json /overleaf/tools/migrations/package.json
  29. COPY patches/ /overleaf/patches/
  30. COPY tools/migrations/ /overleaf/tools/migrations/
  31. RUN cd /overleaf && npm ci --quiet
  32. COPY libraries/fetch-utils/ /overleaf/libraries/fetch-utils/
  33. COPY libraries/logger/ /overleaf/libraries/logger/
  34. COPY libraries/metrics/ /overleaf/libraries/metrics/
  35. COPY libraries/mongo-utils/ /overleaf/libraries/mongo-utils/
  36. COPY libraries/o-error/ /overleaf/libraries/o-error/
  37. COPY libraries/object-persistor/ /overleaf/libraries/object-persistor/
  38. COPY libraries/overleaf-editor-core/ /overleaf/libraries/overleaf-editor-core/
  39. COPY libraries/promise-utils/ /overleaf/libraries/promise-utils/
  40. COPY libraries/redis-wrapper/ /overleaf/libraries/redis-wrapper/
  41. COPY libraries/settings/ /overleaf/libraries/settings/
  42. COPY libraries/stream-utils/ /overleaf/libraries/stream-utils/
  43. COPY libraries/validation-tools/ /overleaf/libraries/validation-tools/
  44. COPY services/history-v1/ /overleaf/services/history-v1/
  45. COPY tools/migrations/ /overleaf/tools/migrations/
  46. FROM app
  47. USER node
  48. CMD ["node", "--expose-gc", "app.js"]