Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to newer node and nginx in the Dockerfile #454

Merged
merged 1 commit into from
Jan 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 17 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
# ===============================================
FROM helsinkitest/node:10-slim as appbase
FROM node:14-slim AS appbase
# ===============================================

RUN groupadd -g 1001 appuser \
&& useradd --create-home --no-log-init -u 1001 -g 1001 appuser

RUN mkdir /app
RUN chown -R appuser:appuser /app

WORKDIR /app

# Offical image has npm log verbosity as info. More info - https://github.com/nodejs/docker-node#verbosity
ENV NPM_CONFIG_LOGLEVEL warn

Expand All @@ -27,14 +36,18 @@ COPY package*.json *yarn* ./
ENV PATH /app/node_modules/.bin:$PATH

USER root
RUN bash /tools/apt-install.sh build-essential
RUN apt-get update
RUN apt-get install -y --no-install-recommends build-essential python3

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
RUN apt-get remove -y build-essential
RUN apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false
RUN rm -rf /var/lib/apt/lists/*
RUN rm -rf /var/cache/apt/archives

# =============================
FROM appbase as development
Expand All @@ -58,7 +71,7 @@ COPY . /app
RUN yarn compile

# =============================
FROM registry.access.redhat.com/ubi8/nginx-118 as production
FROM registry.access.redhat.com/ubi8/nginx-120 as production
# =============================

USER root
Expand Down
Loading