NYULibraries / primo-endpoint

Metadata aggregator serving json to populate primo
http://52.204.195.130/
Apache License 2.0
1 stars 1 forks source link

Updates for OpenShift #14

Closed kevchu3 closed 2 years ago

kevchu3 commented 2 years ago

Updates for OpenShift. We've also refactored this Dockerfile to build the Haskell base image separately. For reference, here is the BuildConfig that the cloud admins now use, which has been removed from this Dockerfile's instructions. In addition, the Haskell Dockerfile should be placed in its own repository for version control and the build strategies can be updated to use Git: https://docs.openshift.com/container-platform/4.9/cicd/builds/build-strategies.html

apiVersion: build.openshift.io/v1
kind: BuildConfig
metadata:
  labels:
    app: haskell
  name: haskell-latest
spec:
  failedBuildsHistoryLimit: 3
  output:
    to:
      kind: ImageStreamTag
      name: haskell:latest
      namespace: nyu-base-images
  resources:
    limits:
      cpu: 2
      memory: 2Gi
    requests:
      cpu: 100m
      memory: 2Gi
  runPolicy: Serial
  source:
    type: Dockerfile
    dockerfile: |
      FROM ubi:latest
      EXPOSE 8080

      USER root
      # Copy subscription manager configurations
      COPY ./rhsm-conf /etc/rhsm
      COPY ./rhsm-ca /etc/rhsm/ca
      # Delete /etc/rhsm-host to use entitlements from the build container
      RUN rm /etc/rhsm-host && \
          yum update -y && \
          yum clean all && \
      # Install Haskell dependencies
          yum install zlib-devel libicu-devel -y && \
      # Install Haskell
          curl -sSL https://get.haskellstack.org/ | sh
    configMaps:
    - configMap:
        name: rhsm-conf
      destinationDir: rhsm-conf
    - configMap:
        name: rhsm-ca
      destinationDir: rhsm-ca
  strategy:
    dockerStrategy:
      from:
        kind: ImageStreamTag
        name: ubi:latest
        namespace: nyu-base-images
      volumes:
      - name: etc-pki-entitlement
        mounts:
        - destinationPath: /etc/pki/entitlement
        source:
          type: Secret
          secret:
            secretName: etc-pki-entitlement
    type: Docker
  successfulBuildsHistoryLimit: 3
  triggers:
    - type: ImageChange