github.com/quay/claircore@v1.5.28/rhel/dockerfile/testdata/Dockerfile-nodejs10 (about)

     1  FROM ubi8/s2i-base:rhel8.1
     2  
     3  # This image provides a Node.JS environment you can use to run your Node.JS
     4  # applications.
     5  
     6  EXPOSE 8080
     7  
     8  # Add $HOME/node_modules/.bin to the $PATH, allowing user to make npm scripts
     9  # available on the CLI without using npm's --global installation mode
    10  # This image will be initialized with "npm run $NPM_RUN"
    11  # See https://docs.npmjs.com/misc/scripts, and your repo's package.json
    12  # file for possible values of NPM_RUN
    13  # Description
    14  # Environment:
    15  # * $NPM_RUN - Select an alternate / custom runtime mode, defined in your package.json files' scripts section (default: npm run "start").
    16  # Expose ports:
    17  # * 8080 - Unprivileged port used by nodejs application
    18  
    19  ENV NODEJS_VERSION=10 \
    20      NPM_RUN=start \
    21      NAME=nodejs \
    22      NPM_CONFIG_PREFIX=$HOME/.npm-global \
    23      PATH=$HOME/node_modules/.bin/:$HOME/.npm-global/bin/:$PATH
    24  
    25  ENV SUMMARY="Platform for building and running Node.js $NODEJS_VERSION applications" \
    26      DESCRIPTION="Node.js $NODEJS_VERSION available as container is a base platform for \
    27  building and running various Node.js $NODEJS_VERSION applications and frameworks. \
    28  Node.js is a platform built on Chrome's JavaScript runtime for easily building \
    29  fast, scalable network applications. Node.js uses an event-driven, non-blocking I/O model \
    30  that makes it lightweight and efficient, perfect for data-intensive real-time applications \
    31  that run across distributed devices."
    32  
    33  LABEL summary="$SUMMARY" \
    34        description="$DESCRIPTION" \
    35        io.k8s.description="$DESCRIPTION" \
    36        io.k8s.display-name="Node.js $NODEJS_VERSION" \
    37        io.openshift.expose-services="8080:http" \
    38        io.openshift.tags="builder,$NAME,${NAME}${NODEJS_VERSION}" \
    39        io.openshift.s2i.scripts-url="image:///usr/libexec/s2i" \
    40        io.s2i.scripts-url="image:///usr/libexec/s2i" \
    41        com.redhat.dev-mode="DEV_MODE:false" \
    42        com.redhat.deployments-dir="${APP_ROOT}/src" \
    43        com.redhat.dev-mode.port="DEBUG_PORT:5858" \
    44        com.redhat.component="${NAME}-${NODEJS_VERSION}-container" \
    45        name="ubi8/$NAME-$NODEJS_VERSION" \
    46        version="1" \
    47        com.redhat.license_terms="https://www.redhat.com/en/about/red-hat-end-user-license-agreements#UBI" \
    48        maintainer="SoftwareCollections.org <sclorg@redhat.com>" \
    49        help="For more information visit https://github.com/sclorg/s2i-nodejs-container" \
    50        usage="s2i build <SOURCE-REPOSITORY> ubi8/$NAME-$NODEJS_VERSION:latest <APP-NAME>"
    51  
    52  RUN yum -y module enable nodejs:$NODEJS_VERSION && \
    53      INSTALL_PKGS="nodejs npm nodejs-nodemon nss_wrapper" && \
    54      ln -s /usr/lib/node_modules/nodemon/bin/nodemon.js /usr/bin/nodemon && \
    55      yum remove -y $INSTALL_PKGS && \
    56      yum install -y --setopt=tsflags=nodocs $INSTALL_PKGS && \
    57      rpm -V $INSTALL_PKGS && \
    58      yum clean all -y
    59  
    60  # Copy the S2I scripts from the specific language image to $STI_SCRIPTS_PATH
    61  COPY ./s2i/bin/ $STI_SCRIPTS_PATH
    62  
    63  # Copy extra files to the image.
    64  COPY ./root/ /
    65  
    66  # Drop the root user and make the content of /opt/app-root owned by user 1001
    67  RUN chown -R 1001:0 ${APP_ROOT} && chmod -R ug+rwx ${APP_ROOT} && \
    68      rpm-file-permissions
    69  
    70  USER 1001
    71  
    72  # Set the default CMD to print the usage of the language image
    73  CMD $STI_SCRIPTS_PATH/usage