diff --git a/.ci-operator.yaml b/.ci-operator.yaml deleted file mode 100644 index b5c3b86c..00000000 --- a/.ci-operator.yaml +++ /dev/null @@ -1,4 +0,0 @@ -build_root_image: - name: nodejs-18 - namespace: openshift - tag: latest \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index d484902a..0c11e691 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,9 +5,19 @@ FROM registry.ci.openshift.org/ocp/builder:rhel-9-base-nodejs-openshift-4.22 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.22:base-rhel9 @@ -15,20 +25,13 @@ FROM registry.ci.openshift.org/ocp/4.22: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 diff --git a/Dockerfile.art b/Dockerfile.art index 1fcaf035..0c11e691 100644 --- a/Dockerfile.art +++ b/Dockerfile.art @@ -5,8 +5,19 @@ FROM registry.ci.openshift.org/ocp/builder:rhel-9-base-nodejs-openshift-4.22 AS COPY . /opt/app-root/src/app WORKDIR /opt/app-root/src/app +USER 0 + +# 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 -RUN CYPRESS_INSTALL_BINARY=0 npm ci && npm run 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.22:base-rhel9