|
|
@@ -7,27 +7,25 @@ FROM $OVERLEAF_BASE_TAG
|
|
|
|
|
|
WORKDIR /overleaf
|
|
|
|
|
|
-# Add required source files
|
|
|
-# -------------------------
|
|
|
-ADD server-ce/genScript.js /overleaf/genScript.js
|
|
|
-ADD server-ce/services.js /overleaf/services.js
|
|
|
-ADD package.json package-lock.json /overleaf/
|
|
|
-ADD libraries/ /overleaf/libraries/
|
|
|
-ADD services/ /overleaf/services/
|
|
|
-ADD tools/migrations/ /overleaf/tools/migrations/
|
|
|
-
|
|
|
-# Add npm patches
|
|
|
-# -----------------------
|
|
|
-ADD patches/ /overleaf/patches
|
|
|
+# Add required source files for npm install
|
|
|
+# -----------------------------------------
|
|
|
+COPY --parents libraries/*/package.json patches/ services/*/package.json tools/migrations/ package.json package-lock.json /overleaf/
|
|
|
+COPY server-ce/genScript.js server-ce/services.js /overleaf/
|
|
|
|
|
|
-# Install npm dependencies and build webpack assets
|
|
|
+# Install npm dependencies
|
|
|
# ------------------------
|
|
|
RUN --mount=type=cache,target=/root/.cache \
|
|
|
--mount=type=cache,target=/root/.npm \
|
|
|
--mount=type=cache,target=/overleaf/services/web/node_modules/.cache,id=server-ce-webpack-cache \
|
|
|
- --mount=type=tmpfs,target=/tmp true \
|
|
|
-&& node genScript install | bash \
|
|
|
-&& node genScript compile | bash
|
|
|
+ --mount=type=tmpfs,target=/tmp node genScript install | bash
|
|
|
+
|
|
|
+# Add the actual source files
|
|
|
+# ---------------------------
|
|
|
+COPY --parents libraries/ services/ tools/migrations/ /overleaf/
|
|
|
+RUN --mount=type=cache,target=/root/.cache \
|
|
|
+ --mount=type=cache,target=/root/.npm \
|
|
|
+ --mount=type=cache,target=/overleaf/services/web/node_modules/.cache,id=server-ce-webpack-cache \
|
|
|
+ --mount=type=tmpfs,target=/tmp node genScript compile | bash
|
|
|
|
|
|
# Copy runit service startup scripts to its location
|
|
|
# --------------------------------------------------
|