mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
90fbbb9198
[misc] bump the node version to 10.23.1 GitOrigin-RevId: e612abe5b7e9291f95b3e0544f7edd5ab781b5e5
54 lines
1.1 KiB
Docker
54 lines
1.1 KiB
Docker
# the base image is suitable for running web with /app bind mounted
|
|
FROM node:10.23.1 as base
|
|
|
|
WORKDIR /app
|
|
|
|
# install_deps changes app files and installs npm packages
|
|
# as such it has to run at a later stage
|
|
|
|
RUN apt-get update \
|
|
&& apt-get install -y parallel \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
|
|
# the deps image is used for caching npm ci
|
|
FROM base as deps
|
|
|
|
COPY package.json package-lock.json /app/
|
|
|
|
RUN npm ci --quiet
|
|
|
|
|
|
# the dev is suitable for running tests
|
|
FROM deps as dev
|
|
|
|
COPY . /app
|
|
|
|
RUN mkdir -p /app/data/dumpFolder && \
|
|
mkdir -p /app/data/logs && \
|
|
mkdir -p /app/data/pdf && \
|
|
mkdir -p /app/data/uploads && \
|
|
mkdir -p /app/data/zippedProjects && \
|
|
chmod -R 0755 /app/data/ && \
|
|
chown -R node:node /app/data/
|
|
|
|
ARG SENTRY_RELEASE
|
|
ENV SENTRY_RELEASE=$SENTRY_RELEASE
|
|
|
|
USER node
|
|
|
|
|
|
# the webpack image has deps+src+webpack artifacts
|
|
FROM dev as webpack
|
|
|
|
USER root
|
|
RUN chmod 0755 ./install_deps.sh && ./install_deps.sh
|
|
|
|
|
|
# the final production image without webpack source maps
|
|
FROM webpack as app
|
|
|
|
RUN find /app/public -name '*.js.map' -delete
|
|
USER node
|
|
|
|
CMD ["node", "--expose-gc", "app.js"]
|