Container Images

Base Images on OpenShift

TIP

Updating base images on OpenShift is only done at the specific Build config;

Updating OpenShift Build Configs

After the images have been updated into the Build Configs for Node, Nginx and Postgres, update the build configs by running the following commands.

# Step 1 - Go to Directory of Repo
cd gdx-agreements-tracker
# Step 2 - Login to OpenShift oc command line
oc login --token=secret-token --server=https://myopnshift.com
# Step 3 - Choose the tools folder
oc project 12345-tools
# step 4 - Apply kustomize file
oc apply -k deployments/kustomize/image-builds

WARNING

Don't forget this step, otherwise base images will never get updated.

S2I Node Base Image

        name: node:18.18-alpine3.18

S2I Nginx Base Image

        name: nginx:1.25.3

Postgres Base Image

        name: postgres:15.5-bullseye

Building Images Locally using Docker

Local development only uses docker for the database, and the app, and api use node on the local machine. The images builds for the app, and api utilizes the OpenShift s2i, therefor these image builds might only be useful for troubleshooting.

NodeJs

Is used for building both the api and frontend application.

# Build
docker build -t node-s2i \
-f openshift/templates/images/nodejs/Dockerfile \
./openshift/templates/images/nodejs/
# Verify
docker run -it --rm node-s2i /usr/local/s2i/usage

Nginx

Is required for building application, creates Nginx server.

# Build
docker build -t nginx-s2i \
-f openshift/templates/images/nginx/docker/Dockerfile \
./openshift/templates/images/nginx/docker/
# Verify
docker run -it --rm nginx-s2i cat /etc/nginx/conf.d/default.conf

Postgres

The PostgreSQL database image

# Build
docker build -t postgres-run \
-f openshift/templates/images/postgres/Dockerfile \
./openshift/templates/images/postgres/
# Verify
docker run -it --rm postgres-run env | grep -i version

Application

The frontend application, however the build is failing on docker, but works with OpenShift

# Build
docker build -t app-run \
-f ./frontend/Dockerfile \
./frontend/
# Verify
docker run -it --rm app-run -p 308080:8080

API

# TBD
Contributors: André Lashley