From 8599055c1b0e69099d56e49408ba3895797047a4 Mon Sep 17 00:00:00 2001 From: cooldragontattoo Date: Wed, 11 Dec 2024 07:50:34 -0700 Subject: [PATCH] add apache image and remove apache volumes from values-yaml --- cfgov/apache/dockerfile | 24 +++++++++++++++++++ helm-init.sh | 8 +++++-- helm/values.local.yaml | 51 ++--------------------------------------- 3 files changed, 32 insertions(+), 51 deletions(-) create mode 100644 cfgov/apache/dockerfile diff --git a/cfgov/apache/dockerfile b/cfgov/apache/dockerfile new file mode 100644 index 00000000000..587e698969a --- /dev/null +++ b/cfgov/apache/dockerfile @@ -0,0 +1,24 @@ +FROM httpd:latest + +# Copy the Apache configuration file +COPY ./conf /usr/local/apache2/conf +COPY ./conf.d /usr/local/apache2/conf.d +COPY ./conf.modules.d /usr/local/apache2/conf.modules.d + +# Add Apache ENV variables +ENV APACHE_PORT="80" +ENV APACHE_USER="www-data" +ENV APACHE_GROUP="www-data" +ENV APACHE_SERVER_ROOT="/usr/local/apache2/" +ENV APACHE_UPLOADS_F_ALIAS="/src/consumerfinance.gov/cfgov/f/" +ENV STATIC_PATH="/tmp" +ENV ERROR_LOG="/proc/self/fd/2" +ENV ACCESS_LOG="/proc/self/fd/1" +ENV LIMIT_REQUEST_BODY="0" +ENV APACHE_STATUS_ALLOW_FROM="127.0.0.1" +ENV APACHE_PROCESS_COUNT="4" +ENV CFGOV_APPLICATION_HOST="localhost" + +EXPOSE 80 + +CMD ["httpd-foreground"] \ No newline at end of file diff --git a/helm-init.sh b/helm-init.sh index f3a5252231e..1ff9600a5fa 100755 --- a/helm-init.sh +++ b/helm-init.sh @@ -22,8 +22,12 @@ fi if ! docker images | grep -q "cfgov"; then echo -e "${RED}Docker images 'cfgov' could not be found." - echo -e "Please run:{$NC} docker build . -t cfgov:latest" - exit 1 + docker build . -t cfgov +fi + +if ! docker images | grep -q "cfgov-apache"; then + echo -e "${RED}Docker images 'cfgov-apache' could not be found." + docker build ./cfgov/apache/. -t cfgov-apache fi # Get the current Kubernetes cluster context diff --git a/helm/values.local.yaml b/helm/values.local.yaml index 525e7ca9529..3eea3d94f8c 100644 --- a/helm/values.local.yaml +++ b/helm/values.local.yaml @@ -66,46 +66,10 @@ containers: value: "9200" - name: cfgov-apache image: - repository: httpd - pullPolicy: IfNotPresent + repository: cfgov-apache + pullPolicy: Never tag: "latest" port: 80 - env: - - name: APACHE_PORT - value: "80" - - name: APACHE_USER - value: "www-data" - - name: APACHE_GROUP - value: "www-data" - - name: APACHE_SERVER_ROOT - value: "/usr/local/apache2/" - - name: APACHE_UPLOADS_F_ALIAS - value: "/src/consumerfinance.gov/cfgov/f/" - - name: STATIC_PATH - value: "/tmp" - - name: ERROR_LOG - value: "/proc/self/fd/2" - - name: ACCESS_LOG - value: "/proc/self/fd/1" - - name: LIMIT_REQUEST_BODY - value: "0" - - name: APACHE_STATUS_ALLOW_FROM - value: "127.0.0.1" - - name: APACHE_PROCESS_COUNT - value: "4" - - name: CFGOV_APPLICATION_HOST - value: "localhost" - # command: - # - 'sh' - # - '-c' - # - 'sleep 1000' - volumeMounts: - - name: apache-conf - mountPath: /usr/local/apache2/conf - - name: apache-confd - mountPath: /usr/local/apache2/conf.d - - name: apache-conf-modules - mountPath: /usr/local/apache2/conf.modules.d # This is for the secretes for pulling an image from a private repository more information can be found here: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/ imagePullSecrets: [] @@ -193,17 +157,6 @@ autoscaling: targetCPUUtilizationPercentage: 80 # targetMemoryUtilizationPercentage: 80 -# Additional volumes on the output Deployment definition. -volumes: -- name: apache-conf - configMap: - name: apache-conf-config -- name: apache-confd - configMap: - name: apache-confd-config -- name: apache-conf-modules - configMap: - name: apache-conf-modules-config # Additional volumeMounts on the output Deployment definition. volumeMounts: [] # - name: foo