diff --git a/services/chat/Dockerfile b/services/chat/Dockerfile index e56792ff9c..242daa44c0 100644 --- a/services/chat/Dockerfile +++ b/services/chat/Dockerfile @@ -2,7 +2,7 @@ # Instead run bin/update_build_scripts from # https://github.com/overleaf/internal/ -FROM node:18.20.2 as base +FROM node:18.20.2 AS base WORKDIR /overleaf/services/chat @@ -10,7 +10,7 @@ WORKDIR /overleaf/services/chat # (see https://googleapis.dev/nodejs/storage/latest/File.html#createWriteStream) RUN mkdir /home/node/.config && chown node:node /home/node/.config -FROM base as app +FROM base AS app COPY package.json package-lock.json /overleaf/ COPY services/chat/package.json /overleaf/services/chat/ diff --git a/services/clsi/Dockerfile b/services/clsi/Dockerfile index 42db8eb794..dc776e4cea 100644 --- a/services/clsi/Dockerfile +++ b/services/clsi/Dockerfile @@ -2,7 +2,7 @@ # Instead run bin/update_build_scripts from # https://github.com/overleaf/internal/ -FROM node:18.20.2 as base +FROM node:18.20.2 AS base WORKDIR /overleaf/services/clsi COPY services/clsi/install_deps.sh /overleaf/services/clsi/ @@ -14,7 +14,7 @@ COPY services/clsi/entrypoint.sh / # (see https://googleapis.dev/nodejs/storage/latest/File.html#createWriteStream) RUN mkdir /home/node/.config && chown node:node /home/node/.config -FROM base as app +FROM base AS app COPY package.json package-lock.json /overleaf/ COPY services/clsi/package.json /overleaf/services/clsi/ diff --git a/services/contacts/Dockerfile b/services/contacts/Dockerfile index ac189202be..2b2d8dae61 100644 --- a/services/contacts/Dockerfile +++ b/services/contacts/Dockerfile @@ -2,7 +2,7 @@ # Instead run bin/update_build_scripts from # https://github.com/overleaf/internal/ -FROM node:18.20.2 as base +FROM node:18.20.2 AS base WORKDIR /overleaf/services/contacts @@ -10,7 +10,7 @@ WORKDIR /overleaf/services/contacts # (see https://googleapis.dev/nodejs/storage/latest/File.html#createWriteStream) RUN mkdir /home/node/.config && chown node:node /home/node/.config -FROM base as app +FROM base AS app COPY package.json package-lock.json /overleaf/ COPY services/contacts/package.json /overleaf/services/contacts/ diff --git a/services/docstore/Dockerfile b/services/docstore/Dockerfile index da64f7c79d..d1a661fc7b 100644 --- a/services/docstore/Dockerfile +++ b/services/docstore/Dockerfile @@ -2,7 +2,7 @@ # Instead run bin/update_build_scripts from # https://github.com/overleaf/internal/ -FROM node:18.20.2 as base +FROM node:18.20.2 AS base WORKDIR /overleaf/services/docstore @@ -10,7 +10,7 @@ WORKDIR /overleaf/services/docstore # (see https://googleapis.dev/nodejs/storage/latest/File.html#createWriteStream) RUN mkdir /home/node/.config && chown node:node /home/node/.config -FROM base as app +FROM base AS app COPY package.json package-lock.json /overleaf/ COPY services/docstore/package.json /overleaf/services/docstore/ diff --git a/services/document-updater/Dockerfile b/services/document-updater/Dockerfile index 2efc4ad3c5..06c1610c66 100644 --- a/services/document-updater/Dockerfile +++ b/services/document-updater/Dockerfile @@ -2,7 +2,7 @@ # Instead run bin/update_build_scripts from # https://github.com/overleaf/internal/ -FROM node:18.20.2 as base +FROM node:18.20.2 AS base WORKDIR /overleaf/services/document-updater @@ -10,7 +10,7 @@ WORKDIR /overleaf/services/document-updater # (see https://googleapis.dev/nodejs/storage/latest/File.html#createWriteStream) RUN mkdir /home/node/.config && chown node:node /home/node/.config -FROM base as app +FROM base AS app COPY package.json package-lock.json /overleaf/ COPY services/document-updater/package.json /overleaf/services/document-updater/ diff --git a/services/filestore/Dockerfile b/services/filestore/Dockerfile index b2952ed7af..6593f60161 100644 --- a/services/filestore/Dockerfile +++ b/services/filestore/Dockerfile @@ -2,7 +2,7 @@ # Instead run bin/update_build_scripts from # https://github.com/overleaf/internal/ -FROM node:18.20.2 as base +FROM node:18.20.2 AS base WORKDIR /overleaf/services/filestore COPY services/filestore/install_deps.sh /overleaf/services/filestore/ @@ -12,7 +12,7 @@ RUN chmod 0755 ./install_deps.sh && ./install_deps.sh # (see https://googleapis.dev/nodejs/storage/latest/File.html#createWriteStream) RUN mkdir /home/node/.config && chown node:node /home/node/.config -FROM base as app +FROM base AS app COPY package.json package-lock.json /overleaf/ COPY services/filestore/package.json /overleaf/services/filestore/ diff --git a/services/git-bridge/Dockerfile b/services/git-bridge/Dockerfile index e58889e080..0d8b1e43e5 100644 --- a/services/git-bridge/Dockerfile +++ b/services/git-bridge/Dockerfile @@ -1,6 +1,6 @@ # Dockerfile for git-bridge -FROM maven:3-amazoncorretto-21-debian as base +FROM maven:3-amazoncorretto-21-debian AS base RUN apt-get update && apt-get install -y make git sqlite3 \ && rm -rf /var/lib/apt/lists @@ -10,7 +10,7 @@ RUN chmod +x /opt/envsubst RUN useradd --create-home node -FROM base as builder +FROM base AS builder COPY . /app diff --git a/services/history-v1/Dockerfile b/services/history-v1/Dockerfile index 69204e21e6..cf6d0b3aaf 100644 --- a/services/history-v1/Dockerfile +++ b/services/history-v1/Dockerfile @@ -2,7 +2,7 @@ # Instead run bin/update_build_scripts from # https://github.com/overleaf/internal/ -FROM node:18.20.2 as base +FROM node:18.20.2 AS base WORKDIR /overleaf/services/history-v1 @@ -13,7 +13,7 @@ RUN mkdir /home/node/.config && chown node:node /home/node/.config # fs persistor needs a writable folder as a target for the mounted volume RUN mkdir /buckets && chown node:node /buckets -FROM base as app +FROM base AS app COPY package.json package-lock.json /overleaf/ COPY services/history-v1/package.json /overleaf/services/history-v1/ diff --git a/services/notifications/Dockerfile b/services/notifications/Dockerfile index 571d3f2b0e..0267a84c4a 100644 --- a/services/notifications/Dockerfile +++ b/services/notifications/Dockerfile @@ -2,7 +2,7 @@ # Instead run bin/update_build_scripts from # https://github.com/overleaf/internal/ -FROM node:18.20.2 as base +FROM node:18.20.2 AS base WORKDIR /overleaf/services/notifications @@ -10,7 +10,7 @@ WORKDIR /overleaf/services/notifications # (see https://googleapis.dev/nodejs/storage/latest/File.html#createWriteStream) RUN mkdir /home/node/.config && chown node:node /home/node/.config -FROM base as app +FROM base AS app COPY package.json package-lock.json /overleaf/ COPY services/notifications/package.json /overleaf/services/notifications/ diff --git a/services/project-history/Dockerfile b/services/project-history/Dockerfile index 6a14f5a5cd..e6b53ad0e9 100644 --- a/services/project-history/Dockerfile +++ b/services/project-history/Dockerfile @@ -2,7 +2,7 @@ # Instead run bin/update_build_scripts from # https://github.com/overleaf/internal/ -FROM node:18.20.2 as base +FROM node:18.20.2 AS base WORKDIR /overleaf/services/project-history @@ -10,7 +10,7 @@ WORKDIR /overleaf/services/project-history # (see https://googleapis.dev/nodejs/storage/latest/File.html#createWriteStream) RUN mkdir /home/node/.config && chown node:node /home/node/.config -FROM base as app +FROM base AS app COPY package.json package-lock.json /overleaf/ COPY services/project-history/package.json /overleaf/services/project-history/ diff --git a/services/real-time/Dockerfile b/services/real-time/Dockerfile index c7c6c67c29..f6e76c41be 100644 --- a/services/real-time/Dockerfile +++ b/services/real-time/Dockerfile @@ -2,7 +2,7 @@ # Instead run bin/update_build_scripts from # https://github.com/overleaf/internal/ -FROM node:18.20.2 as base +FROM node:18.20.2 AS base WORKDIR /overleaf/services/real-time @@ -10,7 +10,7 @@ WORKDIR /overleaf/services/real-time # (see https://googleapis.dev/nodejs/storage/latest/File.html#createWriteStream) RUN mkdir /home/node/.config && chown node:node /home/node/.config -FROM base as app +FROM base AS app COPY package.json package-lock.json /overleaf/ COPY services/real-time/package.json /overleaf/services/real-time/ diff --git a/services/spelling/Dockerfile b/services/spelling/Dockerfile index e583c9d0c4..d636b3ca70 100644 --- a/services/spelling/Dockerfile +++ b/services/spelling/Dockerfile @@ -2,7 +2,7 @@ # Instead run bin/update_build_scripts from # https://github.com/overleaf/internal/ -FROM node:18.20.2 as base +FROM node:18.20.2 AS base WORKDIR /overleaf/services/spelling COPY services/spelling/install_deps.sh /overleaf/services/spelling/ @@ -12,7 +12,7 @@ RUN chmod 0755 ./install_deps.sh && ./install_deps.sh # (see https://googleapis.dev/nodejs/storage/latest/File.html#createWriteStream) RUN mkdir /home/node/.config && chown node:node /home/node/.config -FROM base as app +FROM base AS app COPY package.json package-lock.json /overleaf/ COPY services/spelling/package.json /overleaf/services/spelling/ diff --git a/services/web/Dockerfile b/services/web/Dockerfile index 1e85c801fb..96e495977c 100644 --- a/services/web/Dockerfile +++ b/services/web/Dockerfile @@ -1,6 +1,6 @@ # the base image is suitable for running web with /overleaf/services/web bind # mounted -FROM node:18.20.2 as base +FROM node:18.20.2 AS base WORKDIR /overleaf/services/web @@ -22,7 +22,7 @@ RUN mkdir -p /overleaf/services/web/data/dumpFolder \ # the deps image is used for caching npm ci -FROM base as deps-prod +FROM base AS deps-prod COPY package.json package-lock.json /overleaf/ COPY services/web/package.json /overleaf/services/web/ @@ -31,7 +31,7 @@ COPY patches/ /overleaf/patches/ RUN cd /overleaf && NODE_ENV=production npm ci --quiet -FROM deps-prod as deps +FROM deps-prod AS deps ENV CYPRESS_INSTALL_BINARY=0 @@ -40,7 +40,7 @@ RUN cd /overleaf && npm install # the dev is suitable for running tests -FROM deps as dev +FROM deps AS dev ARG SENTRY_RELEASE ENV SENTRY_RELEASE=$SENTRY_RELEASE @@ -53,18 +53,18 @@ USER node # the webpack image has deps+src+webpack artifacts -FROM dev as webpack +FROM dev AS webpack USER root RUN chmod 0755 ./install_deps.sh && ./install_deps.sh # intermediate image for removing source maps ahead of copying into final production image -FROM webpack as webpack-no-sourcemaps +FROM webpack AS webpack-no-sourcemaps RUN find /overleaf/services/web/public -name '*.js.map' -delete # copy source code and precompile pug images -FROM deps-prod as pug +FROM deps-prod AS pug COPY services/web /overleaf/services/web # Omit Server Pro/CE specific scripts from SaaS image RUN rm /overleaf/services/web/modules/server-ce-scripts -rf @@ -72,13 +72,13 @@ RUN OVERLEAF_CONFIG=/overleaf/services/web/config/settings.overrides.saas.js npm # the web image with only production dependencies but no webpack production build, for development -FROM pug as app-only +FROM pug AS app-only USER node CMD ["node", "--expose-gc", "app.js"] # the final production image, with webpack production build but without source maps -FROM pug as app +FROM pug AS app ARG SENTRY_RELEASE ENV SENTRY_RELEASE=$SENTRY_RELEASE COPY --from=webpack-no-sourcemaps /overleaf/services/web/public /overleaf/services/web/public diff --git a/services/web/Dockerfile.frontend_ct b/services/web/Dockerfile.frontend_ct index ec23819826..49fb58843c 100644 --- a/services/web/Dockerfile.frontend_ct +++ b/services/web/Dockerfile.frontend_ct @@ -3,7 +3,7 @@ ARG BRANCH_NAME ARG BUILD_NUMBER ARG CYPRESS_IMAGE -FROM ci/$PROJECT_NAME:$BRANCH_NAME-$BUILD_NUMBER as dev +FROM ci/$PROJECT_NAME:$BRANCH_NAME-$BUILD_NUMBER AS dev FROM $CYPRESS_IMAGE COPY --from=dev /overleaf /overleaf