Unverified Commit 540c9266 authored by William Tucker's avatar William Tucker Committed by GitHub
Browse files

Merge pull request #226 from ESGF/features/rocky9

Features/rocky9
parents 7e1c246a 7fb138e5
Loading
Loading
Loading
Loading
+14 −18
Original line number Diff line number Diff line
@@ -15,8 +15,8 @@ variables:
# Sets up authentication with the configured registry, which defaults to Docker Hub
.dind:
  services:
    - docker:19.03-dind
  image: docker:19.03
    - docker:26.0.0-dind
  image: docker:26.0.0
  variables:
    DOCKER_HOST: tcp://docker:2375
    DOCKER_TLS_CERTDIR: ""
@@ -62,7 +62,7 @@ variables:
    #   If building master, also tag latest
    - test "$CI_COMMIT_REF_NAME" == "master" && docker tag "$REPOSITORY:$CI_COMMIT_SHORT_SHA" "$REPOSITORY:latest"
    # Push all tags
    - docker push $REPOSITORY
    - docker push --all-tags $REPOSITORY
  only:
    # Only run build jobs for branches in the repo, not MRs
    refs:
@@ -130,12 +130,15 @@ build:opa:
    CONTEXT_DIR: $CI_PROJECT_DIR/images/opa
  needs: ["build:base"]

build:search-builder:
  extends: .docker-build
  stage: build-3
  variables:
    CONTEXT_DIR: $CI_PROJECT_DIR/images/search-builder
  needs: ["build:jdk"]
# Ironically, search-builder no longer builds due to an Ivy issue.
# Later Ivy versions resolve that issue, but wont build search.
# For now, we'll rely on already-built versions of the search app.
# build:search-builder:
#   extends: .docker-build
#   stage: build-3
#   variables:
#     CONTEXT_DIR: $CI_PROJECT_DIR/images/search-builder
#   needs: ["build:jdk"]

build:solr:
  extends: .docker-build
@@ -165,19 +168,12 @@ build:python-build:
    CONTEXT_DIR: $CI_PROJECT_DIR/images/python-build
  needs: ["build:conda"]

build:django:
  extends: .docker-build
  stage: build-3
  variables:
    CONTEXT_DIR: $CI_PROJECT_DIR/images/django
  needs: ["build:conda"]

build:search:
  extends: .docker-build
  stage: build-4
  variables:
    CONTEXT_DIR: $CI_PROJECT_DIR/images/search
  needs: ["build:search-builder", "build:tomcat"]
  needs: ["build:tomcat"]

build:thredds:
  extends: .docker-build
@@ -191,4 +187,4 @@ build:auth-service:
  stage: build-4
  variables:
    CONTEXT_DIR: $CI_PROJECT_DIR/images/auth-service
  needs: ["build:python-build", "build:django"]
  needs: ["build:python-build", "build:conda"]
+1 −1
Original line number Diff line number Diff line
@@ -46,7 +46,7 @@
# The Ansible Docker modules require the Docker Python SDK, which requires pip to install, which requires EPEL

- name: Install pip for system python on CentOS / RHEL
  yum:
  dnf:
    name: pip
    state: latest
  when: ansible_distribution == 'CentOS' or ansible_distribution == 'Red Hat Enterprise Linux'
+40 −2
Original line number Diff line number Diff line
@@ -5,8 +5,46 @@
ARG ESGF_REPOSITORY_BASE=esgfdeploy
ARG ESGF_IMAGES_VERSION=latest
ARG GIT_REPOSITORY=https://github.com/cedadev/django-auth-service.git
ARG GIT_VERSION=c0befb6001c813050dbc8e3ca503cd1c7c22f7f0
ARG GIT_VERSION=b5f8c31817a1373828470b0899265be69455a6ec

FROM ${ESGF_REPOSITORY_BASE}/python-build:${ESGF_IMAGES_VERSION} as python-build

FROM ${ESGF_REPOSITORY_BASE}/django:${ESGF_IMAGES_VERSION}
FROM ${ESGF_REPOSITORY_BASE}/conda:${ESGF_IMAGES_VERSION}

USER root

# Install gunicorn server, whitenoise to handle static files and 
# django-flexi-settings for smart handling of settings
RUN pip install --no-cache-dir \
      'gunicorn==20.0.4' \
      'django-flexi-settings==0.1.1' \
      'whitenoise==5.2.0'

# Install gunicorn config file
COPY gunicorn.conf.py /etc/gunicorn/conf.py
COPY wsgi-serve.sh /usr/local/bin/

# Configure Django to use the flexi settings module
ENV DJANGO_SETTINGS_MODULE flexi_settings.settings
# Install the default settings
ENV DJANGO_FLEXI_SETTINGS_ROOT /etc/django/settings.py
COPY conf /etc/django
# Make sure the settings directory exists
RUN mkdir -p /etc/django/settings.d

# Install init scripts and serving script
COPY django-serve.sh /usr/local/bin/
COPY init.d/* /docker-init.d/

# Use ONBUILD instructions to install and configure the application
COPY --from=python-build /build/wheelhouse /build/wheelhouse
#   Install the wheels that we copied
RUN pip install --no-deps /build/wheelhouse/*.whl
#   Install the app settings
COPY settings.d/* /etc/django/settings.d/
#   Make sure to run as the ESGF user
USER $ESGF_UID

# By default, serve the Django application on port 8080
EXPOSE 8080
CMD ["/usr/local/bin/django-serve.sh"]
Loading