Selaa lähdekoodia

Cambios para que compile

Celestino Rey 23 tuntia sitten
vanhempi
sitoutus
b9e6dcd41b

+ 1 - 0
server-ce/.dockerignore

@@ -1,5 +1,6 @@
 .DS_Store
 .git/
+**/node_modules
 services/git-bridge
 server-ce/server-ce
 server-ce/test

+ 11 - 17
server-ce/Dockerfile

@@ -1,4 +1,3 @@
-# syntax=docker/dockerfile:1-labs
 # ---------------------------------------------
 # Overleaf Community Edition (overleaf/overleaf)
 # ---------------------------------------------
@@ -8,9 +7,13 @@ FROM $OVERLEAF_BASE_TAG
 
 WORKDIR /overleaf
 
-# Add required source files for yarn install
-# -------------------------------------------
-COPY --parents libraries/*/package.json .yarn/patches/ services/*/package.json tools/migrations/ package.json yarn.lock .yarnrc.yml /overleaf/
+# Add required source files
+# -------------------------
+COPY libraries/ /overleaf/libraries/
+COPY services/ /overleaf/services/
+COPY tools/migrations/ /overleaf/tools/migrations/
+COPY .yarn/patches/ /overleaf/.yarn/patches/
+COPY package.json yarn.lock .yarnrc.yml /overleaf/
 COPY server-ce/genScript.js server-ce/services.js /overleaf/
 
 # Pre-install yarn via corepack so it is available at runtime for all users
@@ -23,20 +26,11 @@ ENV COREPACK_ENABLE_NETWORK=0
 
 # Install yarn dependencies
 # -------------------------
-RUN --mount=type=cache,target=/root/.cache \
-    --mount=type=cache,target=/root/.yarn/berry/cache,id=server-ce-yarn-cache \
-    --mount=type=cache,target=/usr/local/share/.cache/yarn,id=server-ce-yarn-fallback-cache \
-    --mount=type=tmpfs,target=/tmp node genScript install | bash
+RUN 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/.yarn/berry/cache,id=server-ce-yarn-cache \
-    --mount=type=cache,target=/usr/local/share/.cache/yarn,id=server-ce-yarn-fallback-cache \
-    --mount=type=cache,target=/overleaf/services/web/node_modules/.cache,id=server-ce-webpack-cache \
-    --mount=type=tmpfs,target=/tmp \
-    node genScript compile | bash
+# Compile the source files
+# ------------------------
+RUN node genScript compile | bash
 
 # Copy runit service startup scripts to its location
 # --------------------------------------------------

+ 1 - 5
server-ce/Dockerfile-base

@@ -14,12 +14,8 @@ ENV REBUILT_AFTER="2026-06-05"
 
 # Install dependencies
 # --------------------
-RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
-# Technically, we are using potentially stale package-lists with the below line.
-# Practically, apt refreshes the lists as needed and release builds run in fresh CI VMs without the cache.
-    --mount=type=cache,target=/var/lib/apt/lists,sharing=locked true \
 # Enable caching: https://docs.docker.com/reference/dockerfile/#example-cache-apt-packages
-&&  rm -f /etc/apt/apt.conf.d/docker-clean && echo 'Binary::apt::APT::Keep-Downloaded-Packages "true";' > /etc/apt/apt.conf.d/keep-cache \
+RUN rm -f /etc/apt/apt.conf.d/docker-clean && echo 'Binary::apt::APT::Keep-Downloaded-Packages "true";' > /etc/apt/apt.conf.d/keep-cache \
 &&  apt-get update \
 &&  apt-get install -y \
       unattended-upgrades \

+ 0 - 2
server-ce/Makefile

@@ -30,7 +30,6 @@ build-base:
 	cp .dockerignore $(MONOREPO_ROOT)
 	docker build \
 	  --build-arg BUILDKIT_INLINE_CACHE=1 \
-	  --progress=plain \
 	  --file Dockerfile-base \
 	  --pull \
 	  --cache-from $(OVERLEAF_BASE_LATEST) \
@@ -44,7 +43,6 @@ build-community:
 	cp .dockerignore $(MONOREPO_ROOT)
 	docker build \
 	  --build-arg BUILDKIT_INLINE_CACHE=1 \
-	  --progress=plain \
 	  --build-arg OVERLEAF_BASE_TAG \
 	  --label "com.overleaf.ce.revision=$(MONOREPO_REVISION)" \
 	  --cache-from $(OVERLEAF_LATEST) \

+ 1 - 5
server-ce/hotfix/5.5.3/Dockerfile

@@ -8,11 +8,7 @@ FROM sharelatex/sharelatex:5.5.2
 # Fixup package.json and toolbar-items.tsx
 # Fix cron paths
 COPY *.patch .
-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 \
-  &&  bash -ec 'for p in *.patch; do echo "=== Applying $p ==="; patch -p1 < "$p" && rm $p; done' \
+RUN bash -ec 'for p in *.patch; do echo "=== Applying $p ==="; patch -p1 < "$p" && rm $p; done' \
   &&  npm audit --audit-level=high \
   &&  node genScript compile | bash \
   &&  npm prune --omit=dev \