Skip to content

Commit

Permalink
TCVP-2825 Created static maintenance site
Browse files Browse the repository at this point in the history
  • Loading branch information
KDNeufeld committed Mar 21, 2024
1 parent eacce87 commit 78795b8
Show file tree
Hide file tree
Showing 5 changed files with 276 additions and 0 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/bld-maintenance-site.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Build Maintenance Site

# This workflow will automatically build the maintenance-site project on the creation of a tag in Github.
# The build is then pushed to Openshift, tagged with the gitsha, ie. maintenance-site:5adf53

on:
workflow_dispatch:
push:
tags:
- '*'

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Git Checkout
uses: actions/checkout@v4

- name: Login to OpenShift
uses: docker/login-action@v1
with:
registry: ${{secrets.OPENSHIFT_EXTERNAL_REPOSITORY}}
username: ${{secrets.OPENSHIFT_SA_USERNAME}}
password: ${{secrets.OPENSHIFT_SA_PASSWORD}}

- name: Build and push
env:
COMPOSE_DOCKER_CLI_BUILD: 1
DOCKER_BUILDKIT: 1
CONTEXT: ./infrastructure/static-site/maintenance
IMAGE: ${{secrets.OPENSHIFT_EXTERNAL_REPOSITORY}}/${{secrets.OPENSHIFT_TOOLS_NAMESPACE}}/maintenance-site
run: |
git_sha=$(git rev-parse --short HEAD)
docker build --tag ${IMAGE}:latest -f ${CONTEXT}/Dockerfile ${CONTEXT}
docker push ${IMAGE}:latest
docker tag ${IMAGE}:latest ${IMAGE}:${git_sha}
docker push ${IMAGE}:${git_sha}
12 changes: 12 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -472,6 +472,18 @@ services:
ports:
- "5125:8080"
- "5025:5025"

#############################################################################################
### Static Maintenance Site ###
#############################################################################################
maintenance-site:
container_name: maintenance-site
build:
context: ./infrastructure/static-site/maintenance
dockerfile: ./Dockerfile
ports:
- "8100:8080"


volumes:
data-clamav:
Expand Down
17 changes: 17 additions & 0 deletions infrastructure/static-site/maintenance/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
FROM docker.io/nginx:stable-alpine

COPY ./index.html /usr/share/nginx/html/index.html
COPY ./nginx.conf /etc/nginx/nginx.conf

USER root

# Create necessary directories and set permissions
RUN mkdir -p /usr/share/nginx/tmp/client_temp /usr/share/nginx/tmp/proxy_temp /usr/share/nginx/tmp/fastcgi_temp /usr/share/nginx/tmp/uwsgi_temp /usr/share/nginx/tmp/scgi_temp && \
chown -R nginx:nginx /usr/share/nginx/tmp && \
chmod -R 777 /usr/share/nginx/tmp

EXPOSE 8080

USER nginx

CMD ["sh", "-c", "nginx -g 'daemon off;'"]
Loading

0 comments on commit 78795b8

Please sign in to comment.