ARG REGISTRY_URL=docker.io/aprimediet ARG UBI_VERSION=9.5 FROM ${REGISTRY_URL}/ubi9:${UBI_VERSION} AS builder LABEL maintainer=" aprimediet@gmail.com" ARG NGINX_VERSION=1.24 USER root # Add group and user nginx RUN groupadd -g 10001 nginx && \ useradd -u 10001 -g 10001 -m -d /app -s /sbin/nologin nginx && \ mkdir -p /var/run/nginx && \ chown nginx:nginx /var/run/nginx # Update packages, configure nginx version # and install nginx RUN dnf -y update && \ dnf -y module reset nginx && \ dnf -y module enable nginx:${NGINX_VERSION} && \ dnf -y install nginx && \ dnf -y autoremove && \ dnf -y clean all # Copy Nginx default config files ADD ./etc/ubi9 /etc/nginx ADD ./app /app RUN chown -R nginx:nginx /app USER nginx WORKDIR /app EXPOSE 80 CMD ["nginx"]