2020-02-12 07:54:45 -05:00
|
|
|
FROM node:10.19.0 as base
|
2019-02-19 09:51:34 -05:00
|
|
|
|
|
|
|
WORKDIR /app
|
|
|
|
|
2020-02-12 07:54:45 -05:00
|
|
|
# install_deps changes app files and installs npm packages
|
|
|
|
# as such it has to run at a later stage
|
|
|
|
|
|
|
|
FROM base as app
|
|
|
|
|
2019-08-02 04:47:45 -04:00
|
|
|
COPY package.json package-lock.json /app/
|
2019-02-19 09:51:34 -05:00
|
|
|
|
|
|
|
RUN npm install --quiet
|
|
|
|
|
|
|
|
COPY . /app
|
|
|
|
|
2020-03-31 05:12:46 -04:00
|
|
|
# Set environment variables for Sentry
|
|
|
|
ARG SENTRY_RELEASE
|
|
|
|
ARG BRANCH_NAME
|
|
|
|
ENV SENTRY_RELEASE=$SENTRY_RELEASE
|
|
|
|
ENV BRANCH_NAME=$BRANCH_NAME
|
|
|
|
|
2020-02-12 10:37:32 -05:00
|
|
|
RUN chmod 0755 ./install_deps.sh && ./install_deps.sh
|
|
|
|
|
2020-02-12 07:54:45 -05:00
|
|
|
FROM base
|
2019-02-19 09:51:34 -05:00
|
|
|
|
|
|
|
COPY --from=app /app /app
|
|
|
|
|
|
|
|
WORKDIR /app
|
2020-02-12 10:37:32 -05:00
|
|
|
|
|
|
|
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/
|
|
|
|
|
2019-02-19 09:51:34 -05:00
|
|
|
USER node
|
|
|
|
|
|
|
|
CMD ["node", "--expose-gc", "app.js"]
|