Skip to content

Commit

Permalink
add apache image and remove apache volumes from values-yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
cooldragontattoo committed Dec 11, 2024
1 parent 2fddf73 commit 8599055
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 51 deletions.
24 changes: 24 additions & 0 deletions cfgov/apache/dockerfile
Original file line number Diff line number Diff line change
@@ -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"]
8 changes: 6 additions & 2 deletions helm-init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
51 changes: 2 additions & 49 deletions helm/values.local.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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: []
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 8599055

Please sign in to comment.