Skip to content
Merged
Show file tree
Hide file tree
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
4 changes: 0 additions & 4 deletions .ci-operator.yaml

This file was deleted.

25 changes: 14 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,30 +5,33 @@ FROM registry.ci.openshift.org/ocp/builder:rhel-9-base-nodejs-openshift-4.21 AS
COPY . /opt/app-root/src/app
WORKDIR /opt/app-root/src/app

# Run install as supper tux
USER 0
RUN npm ci && npm run build

# prevent npm registry timeouts when building OKD images
# use 10min fetch timeout and up to 1min between retries
# retry config details: https://www.npmjs.com/package/retry
RUN npm config set loglevel http
RUN npm config set fetch-timeout 600000
RUN npm config set fetch-retries 9
RUN npm config set fetch-retry-factor 2

# Install dependencies and build
ENV CYPRESS_INSTALL_BINARY=0
RUN npm clean-install --ignore-scripts --no-audit && npm run build

# Web server container
FROM registry.ci.openshift.org/ocp/4.21:base-rhel9

RUN INSTALL_PKGS="nginx" && \
dnf install -y --setopt=tsflags=nodocs $INSTALL_PKGS && \
rpm -V $INSTALL_PKGS && \
yum -y clean all --enablerepo='*' && rm -rf /var/cache/dnf/* && \
dnf -y clean all --enablerepo='*' && rm -rf /var/cache/dnf/* && \
chown -R 1001:0 /var/lib/nginx /var/log/nginx /run && \
chmod -R ug+rwX /var/lib/nginx /var/log/nginx /run

# Use none-root user
# Use non-root user
USER 1001

# Set nginx configuration
# COPY nginx.conf /etc/nginx/nginx.conf

# When using ubi9/nginx-120 defaults:
# listen 8080 default_server;
# root /opt/app-root/src;

COPY --from=build /opt/app-root/src/app/dist /opt/app-root/src

# Run the server
Expand Down
22 changes: 14 additions & 8 deletions Dockerfile.art
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,33 @@ FROM registry.ci.openshift.org/ocp/builder:rhel-9-base-nodejs-openshift-4.21 AS

# Copy app source
COPY . /opt/app-root/src/app
COPY $REMOTE_SOURCES $REMOTE_SOURCES_DIR
WORKDIR /opt/app-root/src/app

USER 0
# use dependencies provided by Cachito
RUN test -d ${REMOTE_SOURCES_DIR}/cachito-gomod-with-deps || exit 1; \
cp -f $REMOTE_SOURCES_DIR/cachito-gomod-with-deps/app/{.npmrc,.yarnrc,yarn.lock,registry-ca.pem} . \
&& source ${REMOTE_SOURCES_DIR}/cachito-gomod-with-deps/cachito.env \
&& npm ci && npm run build

# prevent npm registry timeouts when building OKD images
# use 10min fetch timeout and up to 1min between retries
# retry config details: https://www.npmjs.com/package/retry
RUN npm config set loglevel http
RUN npm config set fetch-timeout 600000
RUN npm config set fetch-retries 9
RUN npm config set fetch-retry-factor 2

# Install dependencies and build
ENV CYPRESS_INSTALL_BINARY=0
RUN npm clean-install --ignore-scripts --no-audit && npm run build

# Web server container
FROM registry.ci.openshift.org/ocp/4.21:base-rhel9

RUN INSTALL_PKGS="nginx" && \
dnf install -y --setopt=tsflags=nodocs $INSTALL_PKGS && \
rpm -V $INSTALL_PKGS && \
yum -y clean all --enablerepo='*' && rm -rf /var/cache/dnf/* && \
dnf -y clean all --enablerepo='*' && rm -rf /var/cache/dnf/* && \
chown -R 1001:0 /var/lib/nginx /var/log/nginx /run && \
chmod -R ug+rwX /var/lib/nginx /var/log/nginx /run

# Use none-root user
# Use non-root user
USER 1001

COPY --from=build /opt/app-root/src/app/dist /opt/app-root/src
Expand Down