Skip to content
Snippets Groups Projects
Dockerfile 1.35 KiB
Newer Older
  • Learn to ignore specific revisions
  • lcappelli's avatar
    lcappelli committed
    # Copyright 2018-2023 Istituto Nazionale di Fisica Nucleare
    
    # SPDX-License-Identifier: EUPL-1.2
    
    
    Luca Bassi's avatar
    Luca Bassi committed
    ARG EL_VERSION=9
    
    FROM almalinux:${EL_VERSION}
    
    # https://docs.docker.com/reference/dockerfile/#understand-how-arg-and-from-interact
    ARG EL_VERSION
    
    
    # Allow customization of nginx user ID and name
    ARG USERNAME=nginx
    ARG USER_UID=1000
    ARG USER_GID=${USER_UID}
    
    # install dependencies
    COPY library-scripts/*.sh /tmp/library-scripts/
    
    Luca Bassi's avatar
    Luca Bassi committed
    RUN dnf update -y && \
    
    lcappelli's avatar
    lcappelli committed
        sh /tmp/library-scripts/provide-deps.sh && \
        sh /tmp/library-scripts/provide-user.sh ${USERNAME} ${USER_UID} ${USER_GID} && \
    
        mkdir /pkgs && \
    
    Luca Bassi's avatar
    Luca Bassi committed
        dnf clean all && rm -rf /var/cache/dnf
    
    COPY artifacts/*.rpm /pkgs/
    
    # install nginx httpg + voms and njs dynamic modules (latest version)
    
    lcappelli's avatar
    lcappelli committed
    COPY nginx.repo /etc/yum.repos.d/nginx.repo
    
    Luca Bassi's avatar
    Luca Bassi committed
    RUN rpm -ivh /pkgs/nginx-*.el${EL_VERSION}.httpg.x86_64.rpm && \
        rpm -ivh /pkgs/nginx-module-http-voms-*.el${EL_VERSION}.x86_64.rpm && \
        dnf install -y nginx-module-njs \
    
    # forward request and error logs to docker log collector
        && ln -sf /dev/stdout /var/log/nginx/access.log \
        && ln -sf /dev/stderr /var/log/nginx/error.log
    
    # install nginx + voms and njs dynamic modules
    
    Luca Bassi's avatar
    Luca Bassi committed
    # RUN dnf -y install nginx nginx-module-njs && \
    #     rpm -ivh /pkgs/nginx-module-http-voms-1.24.0-1.el${EL_VERSION}.x86_64.rpm
    
    EXPOSE 80
    
    STOPSIGNAL SIGQUIT
    
    
    Luca Bassi's avatar
    Luca Bassi committed
    CMD ["nginx", "-g", "daemon off;"]