|
@@ -1,6 +1,6 @@
|
|
|
# the base image is suitable for running web with /overleaf/services/web bind
|
|
# the base image is suitable for running web with /overleaf/services/web bind
|
|
|
# mounted
|
|
# mounted
|
|
|
-FROM node:18.20.2 as base
|
|
|
|
|
|
|
+FROM node:18.20.2 AS base
|
|
|
|
|
|
|
|
WORKDIR /overleaf/services/web
|
|
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
|
|
# 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 package.json package-lock.json /overleaf/
|
|
|
COPY services/web/package.json /overleaf/services/web/
|
|
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
|
|
RUN cd /overleaf && NODE_ENV=production npm ci --quiet
|
|
|
|
|
|
|
|
-FROM deps-prod as deps
|
|
|
|
|
|
|
+FROM deps-prod AS deps
|
|
|
|
|
|
|
|
ENV CYPRESS_INSTALL_BINARY=0
|
|
ENV CYPRESS_INSTALL_BINARY=0
|
|
|
|
|
|
|
@@ -40,7 +40,7 @@ RUN cd /overleaf && npm install
|
|
|
|
|
|
|
|
|
|
|
|
|
# the dev is suitable for running tests
|
|
# the dev is suitable for running tests
|
|
|
-FROM deps as dev
|
|
|
|
|
|
|
+FROM deps AS dev
|
|
|
|
|
|
|
|
ARG SENTRY_RELEASE
|
|
ARG SENTRY_RELEASE
|
|
|
ENV SENTRY_RELEASE=$SENTRY_RELEASE
|
|
ENV SENTRY_RELEASE=$SENTRY_RELEASE
|
|
@@ -53,18 +53,18 @@ USER node
|
|
|
|
|
|
|
|
|
|
|
|
|
# the webpack image has deps+src+webpack artifacts
|
|
# the webpack image has deps+src+webpack artifacts
|
|
|
-FROM dev as webpack
|
|
|
|
|
|
|
+FROM dev AS webpack
|
|
|
USER root
|
|
USER root
|
|
|
RUN chmod 0755 ./install_deps.sh && ./install_deps.sh
|
|
RUN chmod 0755 ./install_deps.sh && ./install_deps.sh
|
|
|
|
|
|
|
|
|
|
|
|
|
# intermediate image for removing source maps ahead of copying into final production image
|
|
# 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
|
|
RUN find /overleaf/services/web/public -name '*.js.map' -delete
|
|
|
|
|
|
|
|
|
|
|
|
|
# copy source code and precompile pug images
|
|
# copy source code and precompile pug images
|
|
|
-FROM deps-prod as pug
|
|
|
|
|
|
|
+FROM deps-prod AS pug
|
|
|
COPY services/web /overleaf/services/web
|
|
COPY services/web /overleaf/services/web
|
|
|
# Omit Server Pro/CE specific scripts from SaaS image
|
|
# Omit Server Pro/CE specific scripts from SaaS image
|
|
|
RUN rm /overleaf/services/web/modules/server-ce-scripts -rf
|
|
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
|
|
# 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
|
|
USER node
|
|
|
CMD ["node", "--expose-gc", "app.js"]
|
|
CMD ["node", "--expose-gc", "app.js"]
|
|
|
|
|
|
|
|
|
|
|
|
|
# the final production image, with webpack production build but without source maps
|
|
# the final production image, with webpack production build but without source maps
|
|
|
-FROM pug as app
|
|
|
|
|
|
|
+FROM pug AS app
|
|
|
ARG SENTRY_RELEASE
|
|
ARG SENTRY_RELEASE
|
|
|
ENV SENTRY_RELEASE=$SENTRY_RELEASE
|
|
ENV SENTRY_RELEASE=$SENTRY_RELEASE
|
|
|
COPY --from=webpack-no-sourcemaps /overleaf/services/web/public /overleaf/services/web/public
|
|
COPY --from=webpack-no-sourcemaps /overleaf/services/web/public /overleaf/services/web/public
|