Skip to content

Commit

Permalink
(HP-2047) Revert back to working docker images
Browse files Browse the repository at this point in the history
  • Loading branch information
Riippi committed Feb 8, 2024
1 parent 090a103 commit fb7785d
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ===============================================
FROM registry.access.redhat.com/ubi9/nodejs-16 as appbase
FROM helsinkitest/node:16-slim as appbase
# ===============================================
# Offical image has npm log verbosity as info. More info - https://github.com/nodejs/docker-node#verbosity
ENV NPM_CONFIG_LOGLEVEL warn
Expand All @@ -14,31 +14,27 @@ ENV NPM_CONFIG_PREFIX=/app/.npm-global
ENV PATH=$PATH:/app/.npm-global/bin

# Yarn
# Install yarn and set yarn version
USER root
RUN curl --silent --location https://dl.yarnpkg.com/rpm/yarn.repo | tee /etc/yum.repos.d/yarn.repo
RUN yum -y install yarn
ENV YARN_VERSION 1.22.19
RUN yarn policies set-version $YARN_VERSION

# Use non-root user
USER default
USER appuser

# Copy package.json and package-lock.json/yarn.lock files
COPY package*.json *yarn* ./

# Install npm depepndencies
ENV PATH /app/node_modules/.bin:$PATH

# USER root
# RUN bash /tools/apt-install.sh build-essential
USER root
RUN bash /tools/apt-install.sh build-essential

USER default
USER appuser
RUN yarn config set network-timeout 300000
RUN yarn && yarn cache clean --force

# USER root
# RUN bash /tools/apt-cleanup.sh build-essential
USER root
RUN bash /tools/apt-cleanup.sh build-essential

# =============================
FROM appbase as development
Expand All @@ -49,7 +45,7 @@ ARG NODE_ENV=development
ENV NODE_ENV $NODE_ENV

# copy in our source code last, as it changes the most
COPY --chown=default:default . .
COPY --chown=appuser:appuser . .

# Bake package.json start command into the image
CMD ["react-scripts", "start"]
Expand Down

0 comments on commit fb7785d

Please sign in to comment.